— Function File: [x, y, z] = sph2cart (theta, phi, r)
Transform spherical to cartesian coordinates.
x, y and z must be of same shape.
theta describes the angle relative to the x-axis.
phi is the angle relative to the xy-plane.
r is the distance to the origin (0, 0, 0).