marian42 / circle-fit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Circle-Fit

Simple Circle Fitting Library for Python

Fitting circles is a simple problem. Given a set of points in 2-D space, let's find a "best fit" circle. A simple least-squares algorithm is a simple and effective solution. A novel algorithm came out in 2011 called "Hyper Fit" by Kanatani, et al.

Installation

pip install circle-fit

Usage

Prepare the Data

Your data must have at least two points in 2-D space. Circle-fit expects an array (or similar structure) of shape (n, 2), where n is the number of points in your dataset.
There are two algorithms available: hyper_fit and least_squares_circle. Both return four values:

- xc : x-coordinate of solution center (float)
- yc : y-coordinate of solution center (float)
- R : Radius of solution (float)
- variance or residual (float)

About


Languages

Language:Jupyter Notebook 86.0%Language:Python 14.0%