tangent_points_to_circle_xy

compas.geometry.tangent_points_to_circle_xy(circle, point)[source]

Calculates the tangent points on a circle in the XY plane.

Parameters:
circle[plane, float] | compas.geometry.Circle

Plane and radius of the circle.

point[float, float] or [float, float, float] | compas.geometry.Point

XY(Z) coordinates of a point in the xy plane.

Returns:
tuple[[float, float, 0.0], [float, float, 0.0]]

the tangent points on the circle.

Examples

>>> from compas.geometry import allclose
>>> circle = ((0, 0, 0), (0, 0, 1)), 1.0
>>> point = (2, 4, 0)
>>> t1, t2 = tangent_points_to_circle_xy(circle, point)
>>> allclose(t1, [-0.772, 0.636, 0.000], 1e-3)
True
>>> allclose(t2, [0.972, -0.236, 0.000], 1e-3)
True