Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Hierarchy

  • Spherical

Index

Constructors

  • new Spherical(radius: number, theta: number, phi: number): Spherical
  • 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

Properties

phi: number
radius: number
theta: number

Methods

  • Adds the current Spherical and the given Spherical

    Parameters

    Returns Spherical

    the sum spherical

  • Adds the given spherical to the current spherical

    Parameters

    Returns Spherical

    the current spherical

  • addInPlaceFromFloats(radius: number, theta: number, phi: number): Spherical
  • 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

  • Adds the current Spherical and the given Spherical and stores the result

    Parameters

    • spherical: Spherical

      the spherical to add

    • ref: Spherical

      the spherical to store the result in

    Returns Spherical

    the updated ref

  • asArray(): number[]
  • Converts the current spherical to an array

    reutrns

    the current spherical as an array

    Returns number[]

  • Clones the current spherical

    Returns Spherical

    a clone of the current spherical

  • Copies the source spherical into the current spherical

    Parameters

    • source: Spherical

      the spherical to copy from

    Returns Spherical

    the current spherical

  • copyFromFloats(radius: number, theta: number, phi: number): 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

  • Divides the current Spherical by the given Spherical

    Parameters

    • spherical: Spherical

      the spherical to divide

    Returns Spherical

    the quotient spherical

  • Divides the current Spherical by the given Spherical

    Parameters

    • spherical: Spherical

      the spherical to divide

    Returns Spherical

    the current spherical

  • Divides the current Spherical by the given Spherical and stores the result

    Parameters

    • spherical: Spherical

      the spherical to divide

    • ref: Spherical

      the spherical to store the result in

    Returns Spherical

    the updated ref

  • getClassName(): string
  • Gets the class name

    Returns string

    the string "Spherical"

  • Multiplies the given Spherical with the current Spherical

    Parameters

    • spherical: Spherical

      the spherical to multiply

    Returns Spherical

    the product spherical

  • Multiplies the given Spherical with the current Spherical

    Parameters

    • spherical: Spherical

      the spherical to multiply

    Returns Spherical

    the current spherical

  • Multiplies the given Spherical with the current Spherical and stores the result

    Parameters

    • spherical: Spherical

      the spherical to multiply

    • ref: Spherical

      the spherical to store the result in

    Returns Spherical

    the updated ref

  • Scales the current spherical and returns a new spherical with the scaled coordinates

    Parameters

    • scale: number

      defines the multiplication factor

    Returns Spherical

    the scaled spherical

  • Scales the current spherical

    Parameters

    • scale: number

      defines the multiplication factor

    Returns Spherical

    the current spherical

  • Scales the current spherical and stores the result

    Parameters

    • scale: number

      defines the multiplication factor

    • ref: Spherical

      where to store the result

    Returns Spherical

    the updated ref

  • set(radius: number, theta: number, phi: number): Spherical
  • Sets the values of the current spherical

    Parameters

    • radius: number

      the new radius

    • theta: number

      the new theta

    • phi: number

      the new phi

    Returns Spherical

    the current spherical

  • Sets the values of the current spherical

    Parameters

    • value: number

      the new values

    Returns Spherical

    the current spherical

  • Subtracts the given Spherical from the current Spherical

    Parameters

    • spherical: Spherical

      the spherical to subtract

    Returns Spherical

    the difference spherical

  • subtractFromFloats(radius: number, theta: number, phi: number): 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

  • subtractFromFloatsToRef(radius: number, theta: number, phi: number, ref: Spherical): 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

  • Subtracts the given Spherical from the current Spherical

    Parameters

    • spherical: Spherical

      the spherical to subtract

    Returns Spherical

    the current spherical

  • Subtracts the given Spherical from the current Spherical and stores the result

    Parameters

    • spherical: Spherical

      the spherical to subtract

    • ref: Spherical

      the spherical to store the result in

    Returns Spherical

    the updated ref

  • toString(): string
  • Converts the current spherical to a string

    Returns string

    the current spherical as a string

  • Gets a Vector3 from the current spherical coordinates

    Returns Vector3

    the Vector3

  • Assigns the rectangular coordinates of the current Spherical to a Vector3

    Parameters

    Returns Vector3

    the updated Vector3

  • Converts an array of floats to a spherical

    Parameters

    • array: number[]

      the array to convert

    Returns Spherical

    the converted spherical

  • Gets a Spherical from a Vector3

    Parameters

    Returns Spherical

    a new Spherical

  • Assigns the spherical coordinates from a Vector3

    Parameters

    Returns Spherical

    the updated ref

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited constructor
  • Static method

Settings

Theme