8 #ifndef IMPALGEBRA_VECTOR_3D_H
9 #define IMPALGEBRA_VECTOR_3D_H
20 IMPALGEBRA_BEGIN_NAMESPACE
34 return Vector3D(p1[1]*p2[2]-p1[2]*p2[1],
35 p1[2]*p2[0]-p1[0]*p2[2],
36 p1[0]*p2[1]-p1[1]*p2[0]);
44 if (std::abs(v[1]) > std::abs(v[0])) maxi=1;
45 if (std::abs(v[2]) > std::abs(v[maxi])) maxi=2;
46 if (std::abs(v[maxi]) < .0001) {
49 Vector3D ret= get_ones_vector_d<3>();
50 ret[maxi]=(-v[(maxi+1)%3]-v[(maxi+2)%3])/v[maxi];
60 return std::accumulate(ps.begin(), ps.end(),
61 get_zero_vector_d<3>())/ps.size();
71 for (
unsigned int i = 0; i < ps.size(); i++) {
81 IMPALGEBRA_END_NAMESPACE