In 2d, converting a theta and
radius (in circular polar coordinates) into a cartesian X and Y, are performed via the following functions:
x=cos(theta)*r;
y=sin(theta)*r;
In 3d, a phi angle is added to the spherical polar coordinates and converting theta, phi, and radius into a X, Y, and Z.
If Z is the “height” of the point above the XY-plane, and phi is the
angle between the XY-plane and the vector formed by the line from the origin to (x,y,z), then the following functions can be used.
x = r * cos(theta) * cos(phi)
y = r * sin(theta) * cos(phi)
and
z = r * sin(phi)
Also, see http://cmldev.net/