1 #ifndef EUCLIDEANSPACE_H
2 #define EUCLIDEANSPACE_H
20 template<
typename InputIterator>
21 std::unique_ptr<std::vector<Point>> orthonormalize(InputIterator begin, InputIterator end);
28 template<
typename InputIterator>
29 std::unique_ptr<std::vector<Point>> EuclideanSpace::orthonormalize(InputIterator begin, InputIterator end)
31 std::unique_ptr<std::vector<Point>> basis(
new std::vector<Point>());
34 return ((u*v) * (1/(u*u))) * u;
42 for(
int i = 0; i < dim; ++i)
43 p = p - proj((*basis)[i], p);
45 if(norm->length(p) > 0.000001)
47 p = (1 / norm->length(p)) * p;