Class Point

The Point is specified by a x coordinate and a y coordinate.

Hierarchy

  • Point

Constructors

Properties

Accessors

x y

Methods

Constructors

  • Constructs a point with the given coordinates (x, y).

    Parameters

    • x: number = 0
    • y: number = 0

    Returns Point

Properties

m_x: number
m_y: number

Accessors

  • get x(): number
  • Returns the x coordinate of this point.

    Returns number

  • set x(x): void
  • Sets the x coordinate of this point to the given x coordinate.

    Parameters

    • x: number

    Returns void

  • get y(): number
  • Returns the y coordinate of this point.

    Returns number

  • set y(y): void
  • Sets the y coordinate of this point to the given y coordinate.

    Parameters

    • y: number

    Returns void

Methods

  • Adds the given point to this point. See also sub

    Parameters

    Returns void

  • Returns a copy of this point.

    Returns Point

  • Returns true if this point and other are equal; otherwise returns false.

    Parameters

    Returns boolean

  • Copies the other point to this point.

    Parameters

    Returns void

  • Divides both x and y by the given divisor. See also mul

    Parameters

    • divisor: number

    Returns void

  • Returns true if both the x and y coordinates are set to 0, otherwise returns false.

    Returns boolean

  • Returns the sum of the absolute values of x and y.

    Returns number

  • Multiplies this point's coordinates by the given factor. See also div

    Parameters

    • factor: number

    Returns void

  • Changes the sign of both components.

    Returns void

  • Subtracts the given point from this point. See also add

    Parameters

    Returns void

Generated using TypeDoc