tilt angle of cylinder using euler angles

5 次查看(过去 30 天)
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
Benjamin Schwabe 2012-2-28
You will have to use the Euler Angles. Rotating a cordinate system is exactly what they are doing.
  1 个评论
Melissa
Melissa 2012-2-29
thanks for the response. im just looking into them, any suggestions on references or a way to untilt the cylinder?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by