Export to GitHub

pyeuclid - issue #13

Intersection with Circle always includes end of LineSegment2


Posted on Jun 7, 2011 by Grumpy Camel

Using r36:

>>> from euclid import Circle, LineSegment2 >>> c = Circle(Point2(0.0, 0.0), 1.0) >>> s = LineSegment2(Point2(-4.0, 0.0), Point2(-3.0, 0.0)) >>> s.intersect(c) Point2(-3.00, 0.00)

Expected value is 'None' since segment does not intersect circle.

I attach suggested patch which fixes the issue (and seems not to introduce new ones, though is not fully tested).

Attachments

Comment #1

Posted on Jul 15, 2014 by Swift Monkey

I have a similar issue with a Ray2, probably caused by the same underlying code:

c = Circle(Point2(4,5), 1.0) r = Ray2(Point2(13.0, 5.0), Vector2(1.0, 0.0)) r.intersect(c) Point2(13.00, 5.00)

Status: New

Labels:
Type-Defect Priority-Medium