From: Verner Kranz on
My problem is that I have rigid body (a surface) described with 3
points [B1_x B1_y B1_z], [B2x B2y B2z],[B3x B3y B3z] the body now
moves to another location! so I know the "old" points and I know the
"new" point! how do I find the Euler angles between them???

Verner
From: martin alain on
Verner Kranz wrote:
>
>
> My problem is that I have rigid body (a surface) described with 3
> points [B1_x B1_y B1_z], [B2x B2y B2z],[B3x B3y B3z] the body now
> moves to another location! so I know the "old" points and I know
> the
> "new" point! how do I find the Euler angles between them???
>
> Verner
Dear verner,
3 points not aligned describe a referentiel 3 axis.
you have your old and new referentiel (Rold and Rnew),define the 3
rotations now (psi (yaw), teta (pitch), phi (roll) )with
Rnew=phi*teta*psi*Rold.
alain
From: Verner Kranz on
martin alain wrote:
> 3 points not aligned describe a referentiel 3 axis.
> you have your old and new referentiel (Rold and Rnew),define the 3
> rotations now (psi (yaw), teta (pitch), phi (roll) )with
> Rnew=phi*teta*psi*Rold.
> alain

Ok pitch, yaw and roll is rotation about the x, z and y axis! so how
do I find these in my example? It not just the angles between the new
and old vectors!?

Verner
From: Roger Stafford on
In article <ef1684d.-1(a)webx.raydaftYaTP>, "Verner Kranz"
<buffas007(a)stofanet.dk> wrote:

> My problem is that I have rigid body (a surface) described with 3
> points [B1_x B1_y B1_z], [B2x B2y B2z],[B3x B3y B3z] the body now
> moves to another location! so I know the "old" points and I know the
> "new" point! how do I find the Euler angles between them???
>
> Verner
--------------------
Hello Verner,

I have time to take you through a part of your problem, namely obtaining
the direction and angle of the rotation part of your displacement. From
that point it should be fairly easy to derive the Eulerian angles you are
seeking, and I leave that part to you.

As you are no doubt aware, you may select any point of the solid and
consider the solid's displacement as, first a parallel translation of the
solid from the original location of that point to its final location,
followed by a rotation about an axis with that final location as a fixed
point on the axis. The direction of the axis of rotation and the angle of
rotation remain the same, whatever point is selected. So, in your problem
we choose your point 1 to play that role.

Consider each of the three points as 3-element vectors consisting of
their x,y,z coordinates. Call the old points p1, p2, p3 and the new
points q1, q2, and q3. First we have a parallel translation by q1-p1 of
each point, so that the next locations would be q1, p2+q1-p1, p3+q1-p1.
Then we rotate holding q1 fixed and the final positions are q1, q2, and
q3. This means that in the rotation, point 2 changed by w2 = q2-p2-q1+p1
and point 3 by w3 = q3-p3-q1+p1.

Since this step is a rotation, the two vector differences w2 and w3 must
each be orthogonal to the axis of rotation, so the axis must have the
direction of cross(w2,w3) (vector cross product.) Let r be a unit vector
in this direction:

r = cross(w2,w3)/norm(cross(w2,w3))

The three components of r are the three direction cosines of the axis of
rotation with respect to the x, y, and z coordinate axes. We are half-way
there.

Next we find the angle of rotation. Vector p2-p1 must rotate about the
axis through the angle so that it becomes equal to q2-q1. Similarly p3-p1
rotates to q3-q1. The components of p2-p1 and q2-q1 which are
perpendicular to the axis are:

s2 = cross(cross(r,(p2-p1)),r)
t2 = cross(cross(r,(q2-q1)),r)

Similarly, the perpendicular components of p3-p1 and q3-q1 are:

s3 = cross(cross(r,(p3-p1)),r)
t3 = cross(cross(r,(q3-q1)),r)

Since they are involved in a rotation, vectors s2 and t2 must have the
same magnitude (norm), and the same is true for s3 and t3. Then the angle
of rotation can be found with either:

angle = atan2(norm(cross(s2,t2)),dot(s2,t2)) or
angle = atan2(norm(cross(s3,t3)),dot(s3,t3))

Either of these should yield the same angle. However, for accuracy's sake
we should select the vector pairs s2,t2 or s3,t3 according to whichever
have the larger magnitude. This angle should range anywhere from -pi to
+pi.

You now have the direction cosines of the axis of rotation and the angle
of rotation. From these you can now determine the Eulerian angles. Good
luck!

(Remove "xyzzy" and ".invalid" to send me email.)
Roger Stafford
From: Roger Stafford on
In article
<ellieandrogerxyzzy-2909051044540001(a)pool0221.cvx20-bradley.dialup.earthlink.net>,
ellieandrogerxyzzy(a)mindspring.com.invalid (Roger Stafford) wrote:

> In article <ef1684d.-1(a)webx.raydaftYaTP>, "Verner Kranz"
> <buffas007(a)stofanet.dk> wrote:
>
> > My problem is that I have rigid body (a surface) described with 3
> > points [B1_x B1_y B1_z], [B2x B2y B2z],[B3x B3y B3z] the body now
> > moves to another location! so I know the "old" points and I know the
> > "new" point! how do I find the Euler angles between them???
> >
> > Verner
> --------------------
> Hello Verner,
>
> (SNIP)
>
> Next we find the angle of rotation. Vector p2-p1 must rotate about the
> axis through the angle so that it becomes equal to q2-q1. Similarly p3-p1
> rotates to q3-q1. The components of p2-p1 and q2-q1 which are
> perpendicular to the axis are:
>
> s2 = cross(cross(r,(p2-p1)),r)
> t2 = cross(cross(r,(q2-q1)),r)
>
> Similarly, the perpendicular components of p3-p1 and q3-q1 are:
>
> s3 = cross(cross(r,(p3-p1)),r)
> t3 = cross(cross(r,(q3-q1)),r)
>
> Since they are involved in a rotation, vectors s2 and t2 must have the
> same magnitude (norm), and the same is true for s3 and t3. Then the angle
> of rotation can be found with either:
>
> angle = atan2(norm(cross(s2,t2)),dot(s2,t2)) or
> angle = atan2(norm(cross(s3,t3)),dot(s3,t3))
>
> Either of these should yield the same angle. However, for accuracy's sake
> we should select the vector pairs s2,t2 or s3,t3 according to whichever
> have the larger magnitude. This angle should range anywhere from -pi to
> +pi.
>
> (SNIP)
>
> Roger Stafford
-----------------------
Hello Verner,

I occurs to me that I was in error when I said the result of the 'atan2'
operation I gave you would yield an answer between -pi and +pi. That
would only be true if the first argument could attain negative values, but
norm(cross(s2,t2)) can only be positive. However, you are in need of an
answer that has the full range, -pi to +pi. That can be corrected with
this:

angle = atan2(dot(r,cross(s2,t2)),dot(s2,t2)) and
angle = atan2(dot(r,cross(s3,t3)),dot(s3,t3))

in place of the previous 'atan2' expressions. This angle will be in a
right hand sense in relation to the axis direction r going from s to t.
It will be negative for angles that would exceed pi radians, and has the
full range -pi to +pi.

Also it occurs to me that taking the final cross product with r in
calculating s2, t2, s3, and t3, is unnecessary. It is sufficient to say
just:

s2 = cross(r,(p2-p1))
t2 = cross(r,(q2-q1))
s3 = cross(r,(p3-p1))
t3 = cross(r,(q3-q1))

since these vectors are at right angles from those I previously gave you
and are of the same magnitude, and therefore are separated by the same
rotation angle.

(Remove "xyzzy" and ".invalid" to send me email.)
Roger Stafford
 | 
Pages: 1
Prev: PLP
Next: Qbasic programm into matlab??