Re: Euler angles
- From: ellieandrogerxyzzy@xxxxxxxxxxxxxxxxxxxxxx (Roger Stafford)
- Date: Thu, 29 Sep 2005 17:44:52 GMT
In article <ef1684d.-1@xxxxxxxxxxxxxxxx>, "Verner Kranz"
<buffas007@xxxxxxxxxxx> 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
.
- References:
- Euler angles
- From: Verner Kranz
- Euler angles
- Prev by Date: SUSAN algorithm for corner detction
- Next by Date: calling matlab from java
- Previous by thread: Re: Euler angles
- Next by thread: piezo simulation
- Index(es):
Relevant Pages
|
Loading