[R] 3-D ellipsoid equations update2. Error message when I run R code.

mmstat at comcast.net mmstat at comcast.net
Sat Nov 5 18:15:37 CET 2011



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. 

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>

More information about the R-help mailing list