API

Class Spherical

Class used for (radius, theta, phi) vector representation.

Index
  • Creates a new Spherical object from the given spherical coordinates

    Parameters

    • radius: number

      spherical radius

    • theta: number

      angle from positive y axis to radial line from 0 to PI (vertical)

    • phi: number

      angle from positive x axis measured anticlockwise from -PI to PI (horizontal)

    Returns Spherical

phi: number

angle from positive x axis measured anticlockwise from -PI to PI (horizontal)

radius: number

spherical radius

theta: number

angle from positive y axis to radial line from 0 to PI (vertical)

  • Adds the provided values to the current spherical

    Parameters

    • radius: number

      the amount to add to the radius

    • theta: number

      the amount to add to the theta

    • phi: number

      the amount to add to the phi

    Returns Spherical

    the current spherical

  • Copies the given values into the current spherical

    Parameters

    • radius: number

      the radius to use

    • theta: number

      the theta to use

    • phi: number

      the phi to use

    Returns Spherical

    the current spherical

  • Subtracts the given floats from the current spherical

    Parameters

    • radius: number

      the amount to subtract from the radius

    • theta: number

      the amount to subtract from the theta

    • phi: number

      the amount to subtract from the phi

    Returns Spherical

    the difference spherical

  • Subtracts the given floats from the current spherical

    Parameters

    • radius: number

      the amount to subtract from the radius

    • theta: number

      the amount to subtract from the theta

    • phi: number

      the amount to subtract from the phi

    • ref: Spherical

      the spherical to store the result in

    Returns Spherical

    the updated ref