setFromSphericalCoords method

Vector3 setFromSphericalCoords(
  1. num radius,
  2. num phi,
  3. num theta
)

Implementation

Vector3 setFromSphericalCoords(num radius, num phi, num theta) {
  var sinPhiRadius = Math.sin(phi) * radius;

  x = sinPhiRadius * Math.sin(theta);
  y = Math.cos(phi) * radius;
  z = sinPhiRadius * Math.cos(theta);

  return this;
}