tilt angle of cylinder using euler angles
7 次查看(过去 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
0 个评论
采纳的回答
Benjamin Schwabe
2012-2-28
You will have to use the Euler Angles. Rotating a cordinate system is exactly what they are doing.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!