On Thu, 21 Nov 2002 bbogart@ryerson.ca wrote:
I'm very confused by the values given by cart2sph in zexy 1.1. They conflict with my original expr based equation. So If I have x=5, y=5 and z=5 cart2sph gives me: r=8.66, phi=0.78, theta=0.61 In my own implementation I get: r=8.66, theta=0.955, phi=0.78 [...] Close, but not quite?! sorry my trig is not the best. Can anyone give me a hand with whats going on?
There are two common kinds of spherical coordinates. Some people use longitude&latitude, and some people use longitude&colatitude. Latitude ranges from -Pi/2 to +Pi/2, and Colatitude ranges from 0 to Pi.
Your theta is colatitude, so your point is 0.955 radians south from the north pole. Cart2sph's theta is latitude, so your point is 0.61 radians north of the equator. If values were exact, .61+.955 = Pi/2 radians, the angle from equator to north pole.
Mathieu Bouchard http://artengine.ca/matju