Plotting a point on the edge of a sphere

Your position in 3d is given by two angles (+ radius, which in your case is constant)

x = r * cos(s) * sin(t)
y = r * sin(s) * sin(t)
z = r * cos(t)

here, s is the angle around the z-axis, and t is the height angle, measured ‘down’ from the z-axis.

The picture below shows what the angles represent, s=theta in the range 0 to 2*PI in the xy-plane, and t=phi in the range 0 to PI.

enter image description here

Leave a Comment