I guess this sample is required for some practical application, say a simulation for something done over the Earth. Then, I also guess that the sample does not have to be _absolutely_ exact, but a reasonable approximation can do it. And the ellipsoid is a rotation ellipsoid.
This is my suggestion: (1) Divide the Ellipsoid by latitudes in _n_ horizontal slices in such a way that each slice can be considered "almost" spherical. Of course here lies the problem: depending on the purpose of the simulation, _n_ would be so big as to make it impractical (2) Compute the area of each slice (there are formulas for that, whose error is not very big - again, we rely on the purpose of the simulation) (3) Chose a random slice based on weight = area (4) Chose the random latitude by a uniform from the minimum to the maximum latitude (a much better approximation would give higher weight to the latitude closer to the equator) (5) lon = 2 pi runif(1) # :-) Now the question is: do you know the formulas to compute the area in (2)? I know these formulas exist, I learned them in the last century, but I can't remember them and I don't know how to find them. Alberto Monteiro ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
