Boost logo

Geometry :

Subject: [ggl] How to intersect two linestrings?
From: Hartmut Kaiser (hartmut.kaiser)
Date: 2010-08-28 10:35:19

> > I'm trying to find my way through GGL in order to use it in a real
> > application and got stuck at something which is probably very simple.
> > I have two linestrings std::vector<point_2d>, containing 2 points each
> > (i.e. two line segments). How do I calculate a) whether these line
> > segments intersect, and b) if they intersect, at what (single)
> coordinate?
> >
> line-segments may straddle one another if they are parallel, so the
> intersection object can be either empty, 1 point or a line-segment
> (infinite number of intersections).

I agree, but how do I figure that out using GGL for two line segments?

Regards Hartmut

Meet me at BoostCon

Geometry list run by mateusz at