# Rotate a cylinder to allign axis

johnfriend
Hi i have cylinder geometry . bottom (cross section)circle centre point is x1, y1, z1 and top is x2, yz, z2. cylinder centre axis is not allign with any (Global x,y,z) axis. if i want to align a cylinder with Global axis(x,y,z), what is angle need to rotated with respect to x ,y ,z (Global )axis.

## Answers and Replies

Philosophaie
Declination angle is what you are looking for. The difference between the center will give the spatial coordinates. The (x,y,z), (x1,y1,z1) and (x2,y2,z2) must all be of the same coordinate system or conversion is necessary. Here is the equation for Declination:

DECangle=atan((z2-z1) / sqrt((x2-x1)^2 + (y2-y1)^2))

johnfriend
cylinder model declinde with all three (cartesian)axis. it's declined with theta1 axis with respect to X, theta2 axis with respect to Y and theta3 axis with respect to Z.how to calculate that?

Last edited:
johnfriend
find inclined angle of cylinder?

cylinder model Inclined with all three (x,y,z-cartesian)axis. it's Inclined with theta1 axis with respect to X, theta2 axis with respect to Y and theta3 axis with respect to Z.how to calculate theta1,theta2,theta3?

Philosophaie
Which axis is the cylinder pointing?

Science Advisor
Homework Helper
Gold Member

If you have a vector in the direction of the cylinder axis, a unit vector in that direction has the direction cosines for its components. They are the cosines of your angles.