Re: Rotating a Plane
- From: Raman <raman@xxxxxxxxxxxxxxx>
- Date: Wed, 27 Jun 2007 17:27:19 -0400
Hi Roger,
Thank you so much for your help. This is exactly what I was looking
for. I really appreciate your clear and detailed explanation. It
saves me a lot of time and trouble.
I am working on my program and will let you know when I succeed.
Thanks again,
Raman
Roger Stafford wrote:
the
In article <ef5bd06.1@xxxxxxxxxxxxxxxxxxxxxxx>, Raman
<raman@xxxxxxxxxxxxxxx> wrote:
Hi Roger,problem
Thank you very much for your reply. You are understanding my
right. I want transformation equations for rotating points on
Ioriginal circle to corresponding points on the rotated circle.
wantcircle.
to "map" each point on the original circle to the rotated
Iclockwise
don't want to spin the circle around its axis, so there will bejust
one way (or two ways if we consider clockwise and anti
vector.rotations) to rotate the circle to bring its normal from theoriginal
z-axis to the rotated vector (a,b,c).xy-plane
Again you are right, rotating the circle about a line in the
orthogonal to the a,b,c direction seems good. I guess you meanfind a
vector in x-y plane which is perpendicular to the projection of
(a,b,c) onto x-y plane and then rotate points around this
.how
I would really appreciate if you can provide some details about
to do it. Also, how do we differentiate between clockwise andpoints.
counterclockwise rotations? This will affect mapping of my
again.
Thank you very much and looking forward to hearing from you
---------------------
Thanks,
Raman
As to the direction of rotation, you can adopt the convention
that the
unit vector along the z-axis rotates around a line in the x-y plane
to the
(a,b,c) vector through an angle no more than pi (180 degrees.)
That makes
it unique. Let's assume that the numbers, a, b, and c are
direction
cosines so that a^2 + b^2 + c^2 = 1. Call i = [0,0,1], j =
[0,1,0], and k
= [0,0,1], the famous i, j, k vectors of 3D vector analysis. Call
d = a*i
+ b*j + c*k, a unit vector along the axis of the new circle. Then
the
angle, phi, of rotation is given by cos(phi) = dot(k,d) = c, and
sin(phi)
= sqrt(a^2+b^2). Phi must lie by our understanding between 0 and
pi.
Call w the unit vector along the axis of rotation. Then we must
have
w = cross(k,d)/norm(cross(k,d)) = (-b*i+a*j)/sqrt(a^2+b^2)
For any vector in 3D space, v = x*i + y*j + z*k, we need to derive
the
rotated vector V = X*i + Y*j + Z*k. The vector v can be expressed
as the
sum of the component along the w direction plus the component
orthogonal
to w. The vector dot(v,w)*w is the first component. The quantity
cross(w,v) is a vector with the magnitude of this second component
but is
orthogonal to both components. The quantity cross(cross(w,v),w)
can then
be seen to be this second component itself. If v is rotated
through the
angle phi about w to V, we can express V in terms of these three
vectors
V = dot(v,w)*w + cross(cross(w,v),w)*cos(phi) +
cross(w,v)*sin(phi)
This last equation gives us the equations that define the
transformation
of any point (x,y,z) to a corresponding point (X,Y,Z). (Notice
that no
mention has been made of the circle. If (x,y,z) happen to lie on
the
original circle, then (X,Y,Z) will lie on the corresponding point
of the
rotated circle.) We need to evaluate the above vector expressions
in
terms of x, y, z, a, b, and c to derive the transformation
equations.
dot(v,w)*w = dot((-b*i+a*j)/sqrt(a^2+b^2),x*i+y*j+z*k)*w
= (-b*x+a*y)/sqrt(a^2+b^2)*(-b*i+a*j)/sqrt(a^2+b^2)
= (-b*x+a*y)*(-b*i+a*j)/(a^2+b^2)
cross(w,v) = (a*z*i+b*z*j-(a*x+b*y)*k)/sqrt(a^2+b^2)
cross(cross(w,v),w) = (a*x+b*y)*(a*i+b*j)/(a^2+b^2) + z*k
Now then, I'm going to let you do the rest of the work since I'm
getting
sleepy. Just substitute these last three vectors into the
expression for
V above involving cos(phi) and sin(phi), then separate out the
three
components along i, j, and k, and you have your desired
transformation
equations, with X, Y, and Z in terms of x, y, and z. Well, I'll do
one of
them for you:
X = (-b*x+a*y)*(-b)/(a^2+b^2) +
a*z/sqrt(a^2+b^2)*c +
(a*x+b*y)*a/(a^2+b^2)*sqrt(a^2+b^2)
= b*(b*x-a*y)/(a^2+b^2) + a*(a*x+b*y+c*z)/sqrt(a^2+b^2)
Do a similar manipulation for Y and Z and you have your
transformation.
(Don't forget the assumption above that a^2+b^2+c^2 = 1.)
I fervently hope all this is what you wanted. As you see, there
is good
reason that you might have gotten confused. It's not a trivial
derivation.
Roger Stafford
- Follow-Ups:
- Re: Rotating a Plane
- From: Roger Stafford
- Re: Rotating a Plane
- References:
- Rotating a Plane
- From: Raman
- Re: Rotating a Plane
- From: Roger Stafford
- Re: Rotating a Plane
- From: Raman
- Re: Rotating a Plane
- From: Roger Stafford
- Rotating a Plane
- Prev by Date: Re: Correlate between Measured v FEM displacements
- Next by Date: Re: Speed up...How?!
- Previous by thread: Re: Rotating a Plane
- Next by thread: Re: Rotating a Plane
- Index(es):
Relevant Pages
|