Logo Search packages:      
Sourcecode: inkscape version File versions

IntersectorKind Geom::line_twopoint_intersect ( Geom::Point const &  p00,
Geom::Point const &  p01,
Geom::Point const &  p10,
Geom::Point const &  p11,
Geom::Point result 

Determine whether & where two line segments intersect.

If the two segments don't intersect, then result remains unchanged.

neither segment is zero-length; i.e. p00 != p01 and p10 != p11.

Definition at line 166 of file geom.cpp.

References line_intersection().

    Geom::Point n0 = (p01 - p00).ccw();
    double d0 = dot(n0,p00);
    Geom::Point n1 = (p11 - p10).ccw();
    double d1 = dot(n1,p10);
    return line_intersection(n0, d0, n1, d1, result);

Generated by  Doxygen 1.6.0   Back to index