   Simple 3D trigonometry.
  Can someone check this psuedo code for me please.It's for working out the x,y,z coords for a sphere using 2 angles, horizontal and vertical and the radius of the sphere. It doesn't seem to work properly.x = radius * cos(vert angle) * sin(hoz angle);y = radius * cos(hoz angle);z = radius * sin(vert angle) * sin(hoz angle);   
  The more familiar names for the "horizontal angle" and the "vertical angle" are "latitude" and "longitude".Try these, where latitude is in [-pi/2,pi/2] and longitude is in [-pi,+pi]:x = radius * cos(longitude) * cos(latitude)y = radius * sin(latitude)z = radius * sin(longitude) * cos(latitude)[Edited by - alvaro on June 11, 2009 6:28:37 PM]