Options
All
  • Public
  • Public/Protected
  • All
Menu

Class used to store (r, theta) vector representation

Hierarchy

  • Polar

Index

Constructors

  • new Polar(radius: number, theta: number): Polar
  • Creates a new Polar object

    Parameters

    • radius: number

      the radius of the vector

    • theta: number

      the angle of the vector

    Returns Polar

Properties

radius: number
theta: number

Methods

  • Adds the current Polar and the given Polar

    Parameters

    • polar: Polar

      the polar to add

    Returns Polar

    the sum polar

  • Adds the given polar to the current polar

    Parameters

    • polar: Polar

      the polar to add

    Returns Polar

    the current polar

  • addInPlaceFromFloats(radius: number, theta: number): Polar
  • Adds the provided values to the current polar

    Parameters

    • radius: number

      the amount to add to the radius

    • theta: number

      the amount to add to the theta

    Returns Polar

    the current polar

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

    Parameters

    • polar: Polar

      the polar to add

    • ref: Polar

      the polar to store the result in

    Returns Polar

    the updated ref

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

    reutrns

    the current polar as an array

    Returns number[]

  • Clones the current polar

    Returns Polar

    a clone of the current polar

  • Copies the source polar into the current polar

    Parameters

    • source: Polar

      the polar to copy from

    Returns Polar

    the current polar

  • copyFromFloats(radius: number, theta: number): Polar
  • Copies the given values into the current polar

    Parameters

    • radius: number

      the radius to use

    • theta: number

      the theta to use

    Returns Polar

    the current polar

  • Divides the current Polar by the given Polar

    Parameters

    • polar: Polar

      the polar to divide

    Returns Polar

    the quotient polar

  • Divides the current Polar by the given Polar

    Parameters

    • polar: Polar

      the polar to divide

    Returns Polar

    the current polar

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

    Parameters

    • polar: Polar

      the polar to divide

    • ref: Polar

      the polar to store the result in

    Returns Polar

    the updated ref

  • getClassName(): string
  • Gets the class name

    Returns string

    the string "Polar"

  • Multiplies the given Polar with the current Polar

    Parameters

    • polar: Polar

      the polar to multiply

    Returns Polar

    the product polar

  • Multiplies the given Polar with the current Polar

    Parameters

    • polar: Polar

      the polar to multiply

    Returns Polar

    the current polar

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

    Parameters

    • polar: Polar

      the polar to multiply

    • ref: Polar

      the polar to store the result in

    Returns Polar

    the updated ref

  • scale(scale: number): Polar
  • Scales the current polar and returns a new polar with the scaled coordinates

    Parameters

    • scale: number

      defines the multiplication factor

    Returns Polar

    the scaled polar

  • scaleInPlace(scale: number): Polar
  • Scales the current polar

    Parameters

    • scale: number

      defines the multiplication factor

    Returns Polar

    the current polar

  • Scales the current polar and stores the result

    Parameters

    • scale: number

      defines the multiplication factor

    • ref: Polar

      where to store the result

    Returns Polar

    the updated ref

  • set(radius: number, theta: number): Polar
  • Sets the values of the current polar

    Parameters

    • radius: number

      the new radius

    • theta: number

      the new theta

    Returns Polar

    the current polar

  • setAll(value: number): Polar
  • Sets the values of the current polar

    Parameters

    • value: number

      the new values

    Returns Polar

    the current polar

  • Subtracts the given Polar from the current Polar

    Parameters

    • polar: Polar

      the polar to subtract

    Returns Polar

    the difference polar

  • subtractFromFloats(radius: number, theta: number): Polar
  • Subtracts the given floats from the current polar

    Parameters

    • radius: number

      the amount to subtract from the radius

    • theta: number

      the amount to subtract from the theta

    Returns Polar

    the difference polar

  • subtractFromFloatsToRef(radius: number, theta: number, ref: Polar): Polar
  • Subtracts the given floats from the current polar

    Parameters

    • radius: number

      the amount to subtract from the radius

    • theta: number

      the amount to subtract from the theta

    • ref: Polar

      the polar to store the result in

    Returns Polar

    the updated ref

  • Subtracts the given Polar from the current Polar

    Parameters

    • polar: Polar

      the polar to subtract

    Returns Polar

    the current polar

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

    Parameters

    • polar: Polar

      the polar to subtract

    • ref: Polar

      the polar to store the result in

    Returns Polar

    the updated ref

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

    Returns string

    the current polar as a string

  • Gets the rectangular coordinates of the current Polar

    Returns Vector2

    the rectangular coordinates

  • Gets the rectangular coordinates of the current Polar

    Parameters

    • ref: Vector2

      the reference to assign the result

    Returns Vector2

    the updated reference

  • FromArray(array: number[]): Polar
  • Converts an array of floats to a polar

    Parameters

    • array: number[]

      the array to convert

    Returns Polar

    the converted polar

  • Converts a given Vector2 to its polar coordinates

    Parameters

    Returns Polar

    a Polar

  • Converts a given Vector2 to its polar coordinates

    Parameters

    • v: Vector2

      the Vector2 to convert

    • ref: Polar

      the reference to assign the result

    Returns Polar

    the updated reference

Legend

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

Settings

Theme