17 if (nofHits < 3)
return;
42 for (
int iHit = 0; iHit < nofHits; iHit++) {
46 b1 += (hx * hx + hy * hy) * hx;
47 b2 += (hx * hx + hy * hy) * hy;
48 b3 += (hx * hx + hy * hy);
62 meanX = meanX / (float) (nofHits);
63 meanY = meanY / (float) (nofHits);
75 c[0] = b1 * b22 - b2 * b12;
76 c[1] = b1 * b32 - b3 * b12;
77 c[2] = b2 * b32 - b3 * b22;
79 a[0][0] = a11 * b22 - a21 * b12;
80 a[1][0] = a12 * b22 - a22 * b12;
81 a[2][0] = a13 * b22 - a23 * b12;
83 a[0][1] = a11 * b32 - a31 * b12;
84 a[1][1] = a12 * b32 - a32 * b12;
85 a[2][1] = a13 * b32 - a33 * b12;
87 a[0][2] = a21 * b32 - a31 * b22;
88 a[1][2] = a22 * b32 - a32 * b22;
89 a[2][2] = a23 * b32 - a33 * b22;
91 float det1 = a[0][0] * a[1][1] - a[0][1] * a[1][0];
93 float x11 = (c[0] * a[1][1] - c[1] * a[1][0]) / det1;
94 float x21 = (a[0][0] * c[1] - a[0][1] * c[0]) / det1;
102 sqrt((b3 + b32 * (x11 * x11 + x21 * x21) - a31 * x11 - a32 * x21) / a33);