| point2line index |
|||||||
| Name | lineSegmentIntersection ( ) | ||||||
| Description | Calculates the intersection of two line segments. The code comes from a post on Code & Form by Marius Watz, which led to a response with a more efficient algorithm taken from Graphics Gems. See the original discussion. I had trouble making the algorithm work with floating point values, so I did a workaround. If you happen to know a better solution I'd love to hear about it. Typically you don't need to change the precision value. |
||||||
| Syntax | lineSegmentIntersection(p1, p2, p3, p4); lineSegmentIntersection(p1, p2, p3, p4, precision); |
||||||
| Parameters |
|
||||||
| Returns | null if there is no intersection, otherwise a vector containing the intersection coordinate (Vect2) |
||||||
| Usage | Web & Application | ||||||
| Related | |||||||
| Examples | |
||||||