Represents a fitted circle characterized by position (center position of the fitted circle) and radius of the fitted circle. The field points refers to the data the model is fit to. Points are stored as a matrix (number of points, number of dimensions).

To get the coefficients one can use StatsBase.coef and coefficient names are provided by StatsBase.coefnames

Currently only in 2D.


Gradient weighted algebraic fit

  • x: vector of x coordinates
  • y: vector of y coordiantes
  • p0: starting values for the fit parameters(position x, position y , radius)
  • kwargs are passed to LsqFit.levenberg_marquardt

return (position x, position y , radius)


Gets the algorithm used for the model fitting.


Fit a circle to the points provided as arrays of x and y coordinates

This method uses Kåsa's method The result is a GeometryBasics::Circle

parameterize(a::Float64, b::Float64, r::Float64)

Parameterizes a circle with center a, b and radius r into x, y values (mainly for plotting purposes).


Fit a circle by using the method of Pratt Warning: not optimized


Fit a circle by using the method of Pratt


Fit a circle by using Taubin's method Warning: not optimized

fit(::Type{Circle}, x::AbstractArray, y::AbstractArray; alg=:kasa)

Fit a circle to points provided as arrays of x and y coordinates using the algorithm specified by alg (default is :kasa). Possible algorithms include

  • :kasa for Kåsa's method [1]
  • :taubin for using Taubin's method [2]
  • :pratt for using Pratt's method [3].
  • :pratt_newton for using a more numerically stable Pratt's method [4].

Returns a Circle object