+ Hello, The parametric equations of an ellipsoid can be written in terms of spherical coordinates. The three spherical coordinates are converted to Cartesian coordinates by X=a cos (α) sin(θ) Y=b sin(α) sin(θ) Z=c cos(θ) for α and θ The parameter α varies from 0 to 2 π and θ varies from 0 to π . Here ( X o , Y o ,Z o ) is the center of the ellipsoid, and θ is the angle of rotation. I need to come up with an expression for the ellipsoid expressed parametrically as the path of a point in 3- space. My first try is that it is something like the following: X(alpha)=Xo+a cos(α) cos( θ )-b sin(α) cos( θ ) + c cos( θ ) Y(alpha)=Yo+ cos (α) sin(θ)+b sin(α) cos (θ) Z(alpha)=Zo+a cos (α) sin(θ) +b sin(α) cos( θ ) Most of the books I have read use eigenvectors. The eigenvectors of course consist of the direction cosines. My difficulty is going from that approach to the approach that Alberto Monteiro took in his message on the 9 October 2006. I understand the R code and am using it for a two-dimensional ellipse problem. There does not seem to be allowance for the new coordinates of the center of the ellipsoid under the transformation when using direction cosines. By that I mean adding the centroid coordinates would not be necessary as is done in my "first try". Can you help me extend this to 3 dimensions? Sincerely, Mary A. Marion + [[alternative HTML version deleted]]
mmstat at comcast.net
2011-Nov-05 17:15 UTC
[R] 3-D ellipsoid equations update2. Error message when I run R code.
+ Hello, I want to delete prior questions online but am getting an error message? Please see R code in enclosed file. I don't understand the error message. The parametric equations of an ellipsoid can be written in terms of spherical coordinates. The three spherical coordinates are converted to Cartesian coordinates by X=a cos (?) sin(?) Y=b sin(?) sin(?) Z=c cos(?) The parameter ? varies from 0 to 2 ? and ? varies from 0 to ? . Here ( X o , Y o ,Z o ) is the center of the ellipsoid, and ? is the angle of rotation. I need to come up with an expression for the ellipsoid expressed parametrically as the path of a point in 3- space. I think that it is something like the following: x (alpha)<- x0 + a * cos(theta) * cos(alpha) - b * sin(theta) * sin(alpha) y(alpha) <- y0 + a * cos(theta) * sin(alpha) + b * sin(theta) * cos(alpha) z (alpha)<- z0 + a * cos(theta) * sin(alpha) + c * sin(theta) * cos(alpha) Do I have these equations correct? Most of the books I have read use eigenvectors. The eigenvectors of course consist of the direction cosines. My difficulty is going from that approach to the approach that Alberto Monteiro took in his message on the 9 October 2006. I understand the R code and am using it for a two-dimensional ellipse problem. There does not seem to be allowance for the new coordinates of the center of the ellipsoid under the transformation when using direction cosines. By that I mean adding the centroid coordinates would not be necessary. I need to come up with an example where I do it both ways(as above and using direction cosines). My confusion lies in the fact that rather than one rotational angle theta there are 9 direction cosines. Can you assist with this. Sincerely, Mary A. Marion -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: 3d.r.txt URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20111105/74f2538f/attachment.txt>