turbodombuilder - v0.9.5
    Preparing search index...

    Class Point

    Index

    Constructors

    • Returns Point

      Create a point with coordinates (0, 0)

    • Parameters

      • n: number

        The input value

      Returns Point

      Create a point with coordinates (n, n)

    • Parameters

      • x: number

        The x coordinate

      • y: number

        The y coordinate

      Returns Point

      Create a point with coordinates (x, y)

    • Parameters

      • e: { clientX: number; clientY: number }

        The coordinates

      Returns Point

      Create a point with the clientX/clientY values. Useful for events.

    • Parameters

      Returns Point

      Create a point with the provided coordinates

    • Parameters

      • arr: [number, number]

        The array of size 2.

      Returns Point

      Create a point with the provided [x, y] values.

    • Parameters

      • x: number | Coordinate | [number, number] | { clientX: number; clientY: number }

      Returns Point

    Properties

    x: number
    y: number

    Accessors

    • get abs(): Point

      Returns Point

      A new Point object with the absolute values

      Calculate the absolute value of the coordinates

    • get max(): number

      Returns number

      The maximum value

      Get the maximum value between x and y coordinates

    • get min(): number

      Returns number

      The minimum value

      Get the minimum value between x and y coordinates

    • get length2(): number

      Returns number

    • get length(): number

      Returns number

    Methods

    • Parameters

      Returns number

      Calculate the distance between two Position2D points.

    • Parameters

      • ...arr: Coordinate[]

        Undetermined number of point parameters

      Returns Point

      Calculate the mid-point from the provided points

    • Parameters

      • ...arr: Coordinate[]

        Undetermined number of point parameters

      Returns Point

      Calculate the max on both x and y from the provided points

    • Parameters

      • ...arr: Coordinate[]

        Undetermined number of point parameters

      Returns Point

      Calculate the min on both x and y from the provided points

    • Parameters

      Returns boolean

      A boolean indicating whether they are equal

      Determine whether this point is equal to the provided coordinates

    • Parameters

      • x: number

        The x coordinate

      • y: number

        The y coordinate

      Returns boolean

      A boolean indicating whether they are equal

      Determine whether this point is equal to the provided coordinates

    • Parameters

      • x1: number
      • x2: number

      Returns number

    • Parameters

      • y1: number
      • y2: number

      Returns number

    • Parameters

      • n1: number
      • n2: number

      Returns Point

    • Parameters

      • n: number

        The value to add to both x and y

      Returns Point

      A new Point object with the result

      Add coordinates to this point

    • Parameters

      • x: number

        The value to add to the x coordinate

      • y: number

        The value to add to the y coordinate

      Returns Point

      A new Point object with the result

      Add coordinates to this point

    • Parameters

      Returns Point

      A new Point object with the result

      Add coordinates to this point

    • Parameters

      • n: number

        The value to subtract from both x and y

      Returns Point

      A new Point object with the result

      Subtract coordinates from this point

    • Parameters

      • x: number

        The value to subtract from the x coordinate

      • y: number

        The value to subtract from the y coordinate

      Returns Point

      A new Point object with the result

      Subtract coordinates from this point

    • Parameters

      Returns Point

      A new Point object with the result

      Subtract coordinates from this point

    • Parameters

      • n: number

        The value to multiply both x and y

      Returns Point

      A new Point object with the result

      Multiply coordinates of this point

    • Parameters

      • x: number

        The value to multiply the x coordinate

      • y: number

        The value to multiply the y coordinate

      Returns Point

      A new Point object with the result

      Multiply coordinates of this point

    • Parameters

      Returns Point

      A new Point object with the result

      Multiply coordinates of this point

    • Parameters

      • n: number

        The value to divide both x and y

      Returns Point

      A new Point object with the result

      Divide coordinates of this point

    • Parameters

      • x: number

        The value to divide the x coordinate

      • y: number

        The value to divide the y coordinate

      Returns Point

      A new Point object with the result

      Divide coordinates of this point

    • Parameters

      Returns Point

      A new Point object with the result

      Divide coordinates of this point

    • Parameters

      • n: number

        The value to mod both x and y

      Returns Point

      A new Point object with the result

      Mod coordinates of this point

    • Parameters

      • x: number

        The value to mod the x coordinate

      • y: number

        The value to mod the y coordinate

      Returns Point

      A new Point object with the result

      Mod coordinates of this point

    • Parameters

      Returns Point

      A new Point object with the result

      Mod coordinates of this point

    • Parameters

      Returns number

    • Returns Point

      A new Point object with the same coordinates

      Create a copy of the current point

    • Returns number[]

      An array with x and y coordinates

      Get the coordinates as an array