A line is represented by a point and a vector, it is of infinite length.

Constructors

Properties

Methods

  • Finds the point where two lines intersect returns none if the lines are parallel. *

    Parameters

    • l2: Line
      • Other line we want to check intersection with.

    Returns Optional<Point>

  • Finds what point on this line is closest to the input point.

    Parameters

    • p2: Point

      Point that we want to find closest point for.

    Returns Point

  • Gives the minimum distance from p2 to the line.

    Parameters

    • p2: Point

      Point to get minimum distance for.

    Returns number

  • Gives the minimum distance squared from p2 to the line. This function exists because it doesn't require any Math.sqrt, and is hence a more efficient way if one want to compare distances between many points.

    Parameters

    • p2: Point

      Point to get minimum distance for.

    Returns number

  • Returns what number you would have to multiply the lines vector with to reach the point returned by project when starting from the line's point.

    Parameters

    • p2: Point

      Point whose projection we get the factor for.

    Returns number

Generated using TypeDoc