compas.geometry.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 (tuple) – center, radius of the circle in the xy plane.

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

Returns

points (list of tuples) – the tangent points on the circle

Examples

>>> from compas.geometry import allclose
>>> circle = (0, 0, 0), 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