24 template <
typename Real>
27 public ApprQuery<Real, ApprOrthogonalLine3<Real>, Vector3<Real>>
42 std::vector<int>
const&
indices);
49 template <
typename Real>
56 template <
typename Real>
63 for (
int i = 0; i < numPoints; ++i)
67 Real invSize = ((Real)1) / (Real)numPoints;
71 Real covar00 = (Real)0, covar01 = (Real)0, covar02 = (Real)0;
72 Real covar11 = (Real)0, covar12 = (Real)0, covar22 = (Real)0;
73 for (
int i = 0; i < numPoints; ++i)
76 covar00 += diff[0] * diff[0];
77 covar01 += diff[0] * diff[1];
78 covar02 += diff[0] * diff[2];
79 covar11 += diff[1] * diff[1];
80 covar12 += diff[1] * diff[2];
81 covar22 += diff[2] * diff[2];
92 std::array<Real, 3> eval;
93 std::array<std::array<Real, 3>, 3> evec;
94 es(covar00, covar01, covar02, covar11, covar12, covar22,
false, +1,
104 return eval[1]< eval[2];
111 template <
typename Real>
117 template <
typename Real>
123 template <
typename Real>
127 Real sqrlen =
Dot(diff, diff);
129 Real error =
std::abs(sqrlen - dot*dot);
133 template <
typename Real>
136 std::vector<int>
const&
indices)
142 for (
auto index : indices)
144 mean += observations[
index];
146 Real invSize = ((Real)1) / (Real)indices.size();
150 Real covar00 = (Real)0, covar01 = (Real)0, covar02 = (Real)0;
151 Real covar11 = (Real)0, covar12 = (Real)0, covar22 = (Real)0;
152 for (
auto index : indices)
155 covar00 += diff[0] * diff[0];
156 covar01 += diff[0] * diff[1];
157 covar02 += diff[0] * diff[2];
158 covar11 += diff[1] * diff[1];
159 covar12 += diff[1] * diff[2];
160 covar22 += diff[2] * diff[2];
171 std::array<Real, 3> eval;
172 std::array<std::array<Real, 3>, 3> evec;
173 es(covar00, covar01, covar02, covar11, covar12, covar22,
false, +1,
183 return eval[1]< eval[2];
int GetMinimumRequired() const
gte::BSNumber< UIntegerType > abs(gte::BSNumber< UIntegerType > const &number)
Real Error(Vector3< Real > const &observation) const
GLfixed GLfixed GLint GLint GLfixed points
GLsizei GLenum const void * indices
Line3< Real > mParameters
DualQuaternion< Real > Dot(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
bool Fit(int numPoints, Vector3< Real > const *points)
Line3< Real > const & GetParameters() const