Skip to main content

circle_fitting

Function circle_fitting 

Source
pub fn circle_fitting(x: &[f64], y: &[f64]) -> CircleFitResult
Expand description

Fit a circle to a set of 2D points using the least-squares method.

The algorithm builds the normal equations from the point sums and solves for the circle parameters (cx, cy, r) that minimise the algebraic distance.

ยงPanics

Panics if x and y have different lengths or contain fewer than 3 points (a circle cannot be uniquely determined with fewer than 3 points).