API Docs for: 0.1.0
Show:

Line Class

Defined in: src/Line.js:5

Container for line-related functions

Item Index

Methods

Methods

lineInt

(
  • l1
  • l2
  • precision
)
Array static

Defined in src/Line.js:11

Compute the intersection between two lines.

Parameters:

  • l1 Array

    Line vector 1

  • l2 Array

    Line vector 2

  • precision Number

    Precision to use when checking if the lines are parallel

Returns:

Array:

The intersection point.

segmentsIntersect

(
  • p1
  • p2
  • q1
  • q2
)
Boolean

Defined in src/Line.js:38

Checks if two line segments intersects.

Parameters:

  • p1 Array

    The start vertex of the first line segment.

  • p2 Array

    The end vertex of the first line segment.

  • q1 Array

    The start vertex of the second line segment.

  • q2 Array

    The end vertex of the second line segment.

Returns:

Boolean:

True if the two line segments intersect