Rotation of a point in 3D
Ok I have 1 point lets say x=0 y=1 z=0 so its farlly simple I want to rotate this point around the x axis by 90 degrees this would put it at x=0 y=0 z=1, correct? what equation could I use to use to do this kind of rotaton. equations for all axes please.
It has to be done by me, I can''t use a API command, just if anyone whats to respond with that.
Sorry if I sound a bit demanding but I have wasted lots of time seaching for the answer on the internet, I found nothing.
thanks
It looks like you''re using a right hand coordinate axis. Lets say you have a point P1(x1, y1, z1).
Rotating P1 counterclockwise by an angle A around the x axis when looking from the positive x axis gives a point P2(x2, y2, z2) where
y2 = y1*cos A - z1*sin A
z2 = z1*cos A + y1*sin A
rotating around y axis
z2 = z1*cos A - x1*sin A
x2 = x1*cos A - z1*sin A
rotating around z axis
x2 = x1*cos A - y1*sin A
y2 = y1*cos A + x1*sin A
Rotating P1 counterclockwise by an angle A around the x axis when looking from the positive x axis gives a point P2(x2, y2, z2) where
y2 = y1*cos A - z1*sin A
z2 = z1*cos A + y1*sin A
rotating around y axis
z2 = z1*cos A - x1*sin A
x2 = x1*cos A - z1*sin A
rotating around z axis
x2 = x1*cos A - y1*sin A
y2 = y1*cos A + x1*sin A
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement