Segment intersection seems to work.