Defines a point in two-dimensional coordinates.

Hierarchy

  • Point2d

Constructors

Properties

x: number
y: number

Methods

  • Returns the distance to the given point.

    Parameters

    • value: Point2d

      The point to get the distance from.

    Returns number

  • Parameters

    • scalar: number

    Returns void

  • Parameters

    • scalar: number

    Returns void

  • Rotates the point by the given angle in degree, around a point.

    Parameters

    • angle: number

      The rotation angle.

    • origin: Point2d = ...

      The origin from which the rotation is supposed to be done.

    Returns void

  • Translates the point using the given vector for direction.

    Parameters

    • vector: Vector2d

      The vector defining the direction.

    Returns void

  • Gets the distance between two points.

    Parameters

    • x1: number

      x coordinate of the first point.

    • y1: number

      y coordinate of the first point.

    • x2: number

      x coordinate of the second point.

    • y2: number

      y coordinate of the second point.

    Returns number

    The distance.

Generated using TypeDoc