Linear Algebra and the C Language/a047
The coefficients of a circle with the left inverse (Pseudo-Inverse).
I use Pinv_Rn_mR(); to calculate the coefficients of a circle.
Presentation :
Find the coefficients a, b, c, d of the circle,
ax**2 + ay**2 + bx + cy + d = 0
which crosses these three points
(x[1],y[1]) (x[2],y[2]) (x[3],y[3])
Using the three points we obtain the matrix.
(a)x**2 (a)y**2 (b)x (c)y (d) = 0
x[1]**2 y[1]**2 x[1] y[1] 1 0
x[2]**2 y[2]**2 x[2] y[2] 1 0
x[3]**2 y[3]**2 x[3] y[3] 1 0
This system has three lines and four unknowns (a, b, c, d).
It is a homogeneous system, so it has an infinite number of solutions.
To find a solution, I chose to set a = 1.
We therefore have five rows and five unknowns.
(a)x**2 (a)y**2 x y
1 0 0 0 0 1
0 1 0 0 0 1
x[1]**2 y[1]**2 x[1] y[1] 1 0
x[2]**2 y[2]**2 x[2] y[2] 1 0
x[3]**2 y[3]**2 x[3] y[3] 1 0
All that remains is to solve the system.