23 if (nofHits < 3)
return;
48 for (
int iHit = 0; iHit < nofHits; iHit++) {
52 b1 += (hx * hx + hy * hy) * hx;
53 b2 += (hx * hx + hy * hy) * hy;
54 b3 += (hx * hx + hy * hy);
68 meanX = meanX / (float) (nofHits);
69 meanY = meanY / (float) (nofHits);
81 c[0] = b1 * b22 - b2 * b12;
82 c[1] = b1 * b32 - b3 * b12;
83 c[2] = b2 * b32 - b3 * b22;
85 a[0][0] = a11 * b22 - a21 * b12;
86 a[1][0] = a12 * b22 - a22 * b12;
87 a[2][0] = a13 * b22 - a23 * b12;
89 a[0][1] = a11 * b32 - a31 * b12;
90 a[1][1] = a12 * b32 - a32 * b12;
91 a[2][1] = a13 * b32 - a33 * b12;
93 a[0][2] = a21 * b32 - a31 * b22;
94 a[1][2] = a22 * b32 - a32 * b22;
95 a[2][2] = a23 * b32 - a33 * b22;
97 float det1 = a[0][0] * a[1][1] - a[0][1] * a[1][0];
99 float x11 = (c[0] * a[1][1] - c[1] * a[1][0]) / det1;
100 float x21 = (a[0][0] * c[1] - a[0][1] * c[0]) / det1;
107 float radius =
sqrt((b3 + b32 * (x11 * x11 + x21 * x21) - a31 * x11 - a32 * x21) / a33);