The misc.py module#

Summary#

get_two_circle_intersections

Get the intersection points of two circles.

Description#

Provides auxiliary math functions for PyAnsys Geometry.

Module detail#

misc.get_two_circle_intersections(x0: ansys.geometry.core.typing.Real, y0: ansys.geometry.core.typing.Real, r0: ansys.geometry.core.typing.Real, x1: ansys.geometry.core.typing.Real, y1: ansys.geometry.core.typing.Real, r1: ansys.geometry.core.typing.Real) tuple[tuple[ansys.geometry.core.typing.Real, ansys.geometry.core.typing.Real], tuple[ansys.geometry.core.typing.Real, ansys.geometry.core.typing.Real]] | None#

Get the intersection points of two circles.

Parameters:
x0Real

x coordinate of the first circle.

y0Real

y coordinate of the first circle.

r0Real

Radius of the first circle.

x1Real

x coordinate of the second circle.

y1Real

y coordinate of the second circle.

r1Real

Radius of the second circle.

Returns:
tuple[tuple[Real, Real], tuple[Real, Real]] | None

Intersection points of the two circles if they intersect. The points are returned as ((x3, y3), (x4, y4)), where (x3, y3) and (x4, y4) are the intersection points of the two circles. If the circles do not intersect, then None is returned.

Notes

This function is based on the following StackOverflow post: https://stackoverflow.com/questions/55816902/finding-the-intersection-of-two-circles

That post is based on the following implementation: https://paulbourke.net/geometry/circlesphere/