Represents a single point with x, y coordinates.

Constructors

Properties

x: number
y: number

Methods

  • Returns the distance between this point and p2 squared

    Parameters

    Returns number

  • Returns true if this point and the other have the same coordinates within GlobalConfig.precision error.

    Parameters

    • other: Point

      The other point to compare with.

    Returns boolean

  • Returns the point reached when starting at this point and then moving according to vector.

    Parameters

    Returns Point

  • Rotates this point around a pivotPoint by a certain number of degrees.

    Parameters

    • pivotPoint: Point

      The point around which this point should rotate

    • degrees: number

      The number of degrees that the point should rotate (a circle covers 360 degrees, negative values are ok)

    Returns Point

  • Gives a readable string representing this point.

    Returns string

  • Returns new point that is moved by x, y. Same function as plus, but here taking number instead of vector.

    Parameters

    • x: number
    • y: number

    Returns Point

Generated using TypeDoc