Re: Rotating a Plane



In article <ef5bd06.1@xxxxxxxxxxxxxxxxxxxxxxx>, Raman
<raman@xxxxxxxxxxxxxxx> wrote:

Hi Roger,

Thank you very much for your reply. You are understanding my problem
right. I want transformation equations for rotating points on the
original circle to corresponding points on the rotated circle. I want
to "map" each point on the original circle to the rotated circle. I
don't want to spin the circle around its axis, so there will be just
one way (or two ways if we consider clockwise and anti clockwise
rotations) to rotate the circle to bring its normal from the original
z-axis to the rotated vector (a,b,c).

Again you are right, rotating the circle about a line in the xy-plane
orthogonal to the a,b,c direction seems good. I guess you mean find 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 vector.

I would really appreciate if you can provide some details about how
to do it. Also, how do we differentiate between clockwise and
counterclockwise rotations? This will affect mapping of my points.

Thank you very much and looking forward to hearing from you again.

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
.



Relevant Pages

  • Re: Rotating a Plane
    ... rotating the circle about a line in the ... onto x-y plane and then rotate points around this ... As to the direction of rotation, ... terms of x, y, z, a, b, and c to derive the transformation ...
    (comp.soft-sys.matlab)
  • Re: Diophantine Approach...
    ... be able to rotate that ball around any of potentially 3 axes to move ... of a circle yields another point on the circle. ... the rotation idea I can see a glimmer of hope to a quicker solution. ... squares solution to help you efficiently find a 2 squares solution is ...
    (sci.math)
  • Re: Rotating a vector about another vector
    ... rotations are COUNTER-clockwise about an axis. ... The rotation about the Z axis is just the same as rotating 2D points in the x-y plane - which you can derive yourself using 9th grade trigonometry. ... Next - transformations such as "rotate about an axis" can be combined. ... You are asking for the transformation that rotates points about an arbitrary axis. ...
    (comp.graphics.algorithms)
  • Re: Rotating a Plane
    ... I have to rotate the circle about the origin ... asking for the complete transformation equations of such a rotation, ...
    (comp.soft-sys.matlab)
  • SVG
    ... I would like to create a polygon which will be rotate in a circle. ... created polygon but I have problem with rotation. ...
    (comp.text.xml)

Loading