#### Archived

This topic is now archived and is closed to further replies.

# Rotation of a point in 3D

This topic is 6194 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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

##### Share on other sites
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

##### Share on other sites
Thank you, it worked perfectly.

1. 1
2. 2
3. 3
Rutin
16
4. 4
5. 5

• 12
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633723
• Total Posts
3013545
×