Function tangent_circles

Source
pub fn tangent_circles(
    constraints: [Tangent; 3],
    tolerance: Tolerance,
) -> Result<Vec<Circle2>, TangencyError>
Expand description

Every circle tangent to constraints[0], constraints[1] and constraints[2], in any combination of point, line and circle.

Solutions are returned in ascending order of centre x, then y, then radius, and deduplicated: two candidates within the linear tolerance of each other in both centre and radius are the same solution. A well-posed configuration with no tangent circle (for example, three mutually separate circles too far apart for any sign choice to reach) answers with an empty, not an error: only a configuration that pins down no family of circles at all is refused.

ยงErrors

TangencyError::NonFinite, TangencyError::InvalidRadius for a circle constraint with a non-positive radius, TangencyError::ZeroDirection for a line constraint shorter than the linear tolerance, and TangencyError::Degenerate when no sign choice yields a solvable elimination system.