Given two vectors, there is not a unique solution of euler-like angles that you can solve for that relates the two vectors. If you have a desired set of axes to rotate about you can formulate three non-linear equations from the transformation. You'll like have to solve this numerically though, with a good initial guess. I don't think solving it analytically is trivial (or necessarily possible).
Jason moorepants.info +01 530-601-9791 On Sat, Sep 29, 2018 at 2:43 AM Andrea Danzi <andrea....@gmail.com> wrote: > I did this way: > > - calculate the angle between vector1 and vector2 > - rotate around the axis defined by vector1.cross(vector2) > > v_cross = vect1.cross(vect2) > v_dot = vect1.dot(vect2) > > if v_dot == 0: > v_angle = pi/2. > else: > v_angle =acos( v_dot / ( vect2.magnitude()*vect_base.magnitude() ) ) > > R = N.orient_new_axis('R', v_angle,v_cross) > > > > > > > > Il giorno sabato 29 settembre 2018 10:58:22 UTC+2, Andrea Danzi ha scritto: >> >> I need to instantiate a BodyOrienter that rotates the axis of my "Body" >> parallel to a given arbitrary vector. >> How can I calculate the three successive angles required to rotate the >> coordinate system parallel to the given vector? >> --- >> Andrea >> > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sympy+unsubscr...@googlegroups.com. > To post to this group, send email to sympy@googlegroups.com. > Visit this group at https://groups.google.com/group/sympy. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/082f4048-691d-4b29-83cb-97c3e03300b1%40googlegroups.com > <https://groups.google.com/d/msgid/sympy/082f4048-691d-4b29-83cb-97c3e03300b1%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAP7f1AjaawMDEME7SJvZ8-HGCN4dM-CCVomXVZac%3DQW%2BDf2V3w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.