Intersection
Constructors
new Intersection()
new Intersection(
status?):Intersection
Parameters
• status?: IntersectionType
Returns
Defined in
Properties
points
points:
Point[]
Defined in
status?
optionalstatus:IntersectionType
Defined in
Methods
intersectLineLine()
staticintersectLineLine(a1,a2,b1,b2,aInfinite?,bInfinite?):Intersection
Checks if a line intersects another
Parameters
• a1: Point
• a2: Point
• b1: Point
• b2: Point
• aInfinite?: boolean = true
check segment intersection by passing false
• bInfinite?: boolean = true
check segment intersection by passing false
Returns
See
Static
Defined in
intersectLinePolygon()
staticintersectLinePolygon(a1,a2,points,infinite?):Intersection
Checks if line intersects polygon
Parameters
• a1: Point
point on line
• a2: Point
other point on line
• points: Point[]
polygon points
• infinite?: boolean = true
check segment intersection by passing false
Returns
Todo
account for stroke
Static
See
intersectSegmentPolygon for segment intersection
Defined in
intersectPolygonPolygon()
staticintersectPolygonPolygon(points1,points2):Intersection
Checks if polygon intersects another polygon
Parameters
• points1: Point[]
• points2: Point[]
Returns
Todo
account for stroke
Static
Defined in
intersectPolygonRectangle()
staticintersectPolygonRectangle(points,r1,r2):Intersection
Checks if polygon intersects rectangle
Parameters
• points: Point[]
polygon points
• r1: Point
top left point of rect
• r2: Point
bottom right point of rect
Returns
Static
See
intersectPolygonPolygon for polygon intersection
Defined in
intersectSegmentLine()
staticintersectSegmentLine(s1,s2,l1,l2):Intersection
Checks if a segment intersects a line
Parameters
• s1: Point
boundary point of segment
• s2: Point
other boundary point of segment
• l1: Point
point on line
• l2: Point
other point on line
Returns
See
intersectLineLine for line intersection
Static
Defined in
intersectSegmentPolygon()
staticintersectSegmentPolygon(a1,a2,points):Intersection
Checks if segment intersects polygon
Parameters
• a1: Point
boundary point of segment
• a2: Point
other boundary point of segment
• points: Point[]
polygon points
Returns
Static
See
intersectLinePolygon for line intersection
Defined in
intersectSegmentSegment()
staticintersectSegmentSegment(a1,a2,b1,b2):Intersection
Checks if a segment intersects another
Parameters
• a1: Point
boundary point of segment
• a2: Point
other boundary point of segment
• b1: Point
boundary point of segment
• b2: Point
other boundary point of segment
Returns
See
intersectLineLine for line intersection
Static
Defined in
isPointContained()
staticisPointContained(T,A,B,infinite?):boolean
check if point T is on the segment or line defined between A and B
Parameters
• T: Point
the point we are checking for
• A: Point
one extremity of the segment
• B: Point
the other extremity of the segment
• infinite?: boolean = false
if true checks if T is on the line defined by A and B
Returns
boolean
true if T is contained
Defined in
isPointInPolygon()
staticisPointInPolygon(point,points):boolean
Use the ray casting algorithm to determine if point is in the polygon defined by points
Parameters
• point: Point
• points: Point[]
polygon points
Returns
boolean
See
https://en.wikipedia.org/wiki/Point_in_polygon