skspatial.objects.Circle.intersect_circle¶
- Circle.intersect_circle(other: Circle) Tuple[Point, Point] [source]¶
Intersect the circle with another circle.
A circle intersects a circle at two points.
- Parameters
- otherCircle
Other circle.
- Returns
- point_a, point_bPoint
The two points of intersection.
- Raises
- ValueError
If the centres of the circles are coincident. If the circles are separate. If one circle is contained within the other.
References
http://paulbourke.net/geometry/circlesphere/
Examples
>>> from skspatial.objects import Circle
>>> circle_a = Circle([0, 0], 1) >>> circle_b = Circle([2, 0], 1)
>>> circle_a.intersect_circle(circle_b) (Point([1., 0.]), Point([1., 0.]))
>>> circle_a.intersect_circle(Circle([0, 0], 2)) Traceback (most recent call last): ... ValueError: The centres of the circles are coincident.
>>> circle_a.intersect_circle(Circle([3, 0], 1)) Traceback (most recent call last): ... ValueError: The circles do not intersect. These circles are separate.
>>> Circle([0, 0], 3).intersect_circle(Circle([1, 0], 1)) Traceback (most recent call last): ... ValueError: The circles do not intersect. One circle is contained within the other.