fromSpherical static method

Offset3D fromSpherical(
  1. double theta,
  2. double phi,
  3. double radius
)

Converts spherical coordinates (theta, phi, radius) to cartesian.

Implementation

static Offset3D fromSpherical(double theta, double phi, double radius) {
  return Offset3D(
    radius * cos(phi) * cos(theta),
    radius * cos(phi) * sin(theta),
    radius * sin(phi),
  );
}