# tilt angle of cylinder using euler angles

1 view (last 30 days)
Melissa on 28 Feb 2012
Good Afternoon All,
Below is my original posting of this and with the help of Brian I know I should be using Euler Angles, given that I have the final position of the cylinder and just wish to untilt it parallel to the z axis I know I have to calculate "beta". How would I go about doing so?
Thanks,
Mel
Here is my original post
Was wondering if someone could help me with a bit of geometry and trig derivation. If I'm given the top and bottom center of a cylinder that has a tilt angle, how do I calculate that tilt angle such that is always parallel with the z axis? I want to in essence "untilt" the cylinder so that I can use this for finding the polar coordinates at a particular height on the cylinder.
%Bottom and Top deck centers
XCent = [-94.102, -94.102]; YCent = [66.2796, 166.268]; ZCent = [66.0163, 166.072];
%the cylinder is titled in a V-engine, rotate s.t. parrallel with z-axis
%Why did they do arctan instead of arccos and what if the XCent was the one varied instead of YCent?
[THETA,RHO] = cart2pol(y0,z0);
[TH,PHI,R] = cart2sph(dx0,dy0,dz0);
tiltangle=atan((ZCent(2)-ZCent(1))/(YCent(2)-YCent(1)));
%Why is tiltangled added to theta and phi and why was spherical coordinates used?
THETA = THETA+tiltangle;
PHI = PHI + tiltangle;
x=x0;
[y,z] = pol2cart(THETA,RHO);
[dx,dy,dz]=sph2cart(TH,PHI,R);
[THETA,RHO] = cart2pol(YCent,ZCent);
THETA = THETA+tiltangle;
[YCent,ZCent] = pol2cart(THETA,RHO);
Or maybe I should consider using Euler Angles?
Thanks,
Mel

Benjamin Schwabe on 28 Feb 2012
You will have to use the Euler Angles. Rotating a cordinate system is exactly what they are doing.
Melissa on 29 Feb 2012
thanks for the response. im just looking into them, any suggestions on references or a way to untilt the cylinder?