distance3d.distance.line_to_circle

distance3d.distance.line_to_circle(line_point, line_direction, center, radius, normal)[source]

Compute the shortest distance between line and circle.

This is the nonpolynomial-based algorithm that uses bisection. More details here:

Adapted from C++ implementation of David Eberly, Geometric Tools, Redmond WA 98052 (Copyright (c) 1998-2022) Distributed under the Boost Software License, Version 1.0.

Parameters:
line_pointarray, shape (3,)

Point on line.

line_directionarray, shape (3,)

Direction of the line. This is assumed to be of unit length.

centerarray, shape (3,)

Center of the circle.

radiusfloat

Radius of the circle.

normalarray, shape (3,)

Normal to the plane in which the circle lies.

Returns:
distfloat

The shortest distance between line and circle.

closest_point_linearray, shape (3,)

Closest point on line.

closest_point_circlearray, shape (3,)

Closest point on circle.