## Rotate a cylinder to allign axis

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.
 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))
 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?

## Rotate a cylinder to allign axis

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?
 Which axis is the cylinder pointing?
 Recognitions: Gold Member Homework Help 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.

 Tags cylinder, declined, inclined cylinder, rotate, vector