dot big bang

Developer API
Menu

Class Spherical

All
  • Public
  • Public/Protected
  • All

Hierarchy

  • Spherical

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Spherical(radius?: number, phi?: number, theta?: number): Spherical
  • Creates a new Spherical.

    Parameters

    • Optional radius: number

      The radius, or the Euclidean distance (straight-line distance) from the point to the origin. Default is 1.

    • Optional phi: number

      The polar angle in radians from the y (up) axis. The poles (phi) are at the positive and negative y axis. Default is 0.

    • Optional theta: number

      The equator angle in radians around the y (up) axis. The equator (theta) starts at positive z. Default is 0.

    Returns Spherical

Properties

phi

phi: number

The polar angle in radians from the y (up) axis. The poles (phi) are at the positive and negative y axis.

radius

radius: number

The radius, or the Euclidean distance (straight-line distance) from the point to the origin.

theta

theta: number

The equator angle in radians around the y (up) axis. The equator (theta) starts at positive z.

Methods

clone

  • Returns a new spherical with the same radius, phi and theta properties as this one.

    Returns Spherical

copy

  • Copies the values of the passed Spherical's radius, phi and theta properties into this spherical.

    Parameters

    • other: Spherical

      The other spherical to copy the properties from.

    Returns Spherical

makeSafe

  • Restricts the polar angle phi to be between 0.000001 and pi-0.000001.

    Returns Spherical

set

  • set(radius: number, phi: number, theta: number): Spherical
  • Sets values of this spherical's radius, phi and theta properties.

    Parameters

    • radius: number

      The radius, or the Euclidean distance (straight-line distance) from the point to the origin.

    • phi: number

      The polar angle in radians from the y (up) axis. The poles (phi) are at the positive and negative y axis.

    • theta: number

      The equator angle in radians around the y (up) axis. The equator (theta) starts at positive z.

    Returns Spherical

setFromVector3

  • Sets the values of this spherical's radius, phi and theta properties from Cartesian coordinates.

    Parameters

    • vec3: Vector3

      The Cartesian coordinates vector to set this spherical from.

    Returns Spherical