1 #ifndef MSP_LINAL_VECTOR3_H_
2 #define MSP_LINAL_VECTOR3_H_
10 A three-dimensional vector, applicable for Euclidean space.
13 class Vector3: public Vector<T, 3>
17 Vector3(const T *d): Vector<T, 3>(d) { }
20 Vector3(const Vector<U, 3> &v): Vector<T, 3>(v) { }
24 inline Vector3<T>::Vector3(T x, T y, T z)
32 inline T dot(const Vector<T, 3> &v1, const Vector<T, 3> &v2)
34 return inner_product(v1, v2);
38 inline Vector<T, 3> cross(const Vector<T, 3> &v1, const Vector<T, 3> &v2)
40 return Vector<T, 3>(v1[1]*v2[2]-v1[2]*v2[1], v1[2]*v2[0]-v1[0]*v2[2], v1[0]*v2[1]-v1[1]*v2[0]);