Commit 7f0fcc02 authored by Martin Heistermann's avatar Martin Heistermann

VectorT: Implement .cross() and .dot() methods.

Aliases for operators % and | for better compatibility with Eigen3.
parent 941bfc04
......@@ -377,8 +377,17 @@ class VectorT {
};
}
/// cross product: only defined for Vec3* as specialization
/// \see OpenVolumeMesh::cross and .cross()
template<typename OtherScalar>
auto cross (const VectorT<OtherScalar, DIM> &_rhs) const ->
decltype(*this % _rhs)
{
return *this % _rhs;
}
/// compute scalar product
/// \see OpenVolumeMesh::dot
/// \see OpenVolumeMesh::dot and .dot()
template<typename OtherScalar>
auto operator|(const VectorT<OtherScalar, DIM>& _rhs) const ->
decltype(*this->data() * *_rhs.data()) {
......@@ -387,6 +396,15 @@ class VectorT {
*data() * *_rhs.data());
}
/// compute scalar product
/// \see OpenVolumeMesh::dot and .operator|
template<typename OtherScalar>
auto dot(const VectorT<OtherScalar, DIM>& _rhs) const ->
decltype(*this | _rhs)
{
return *this | _rhs;
}
//------------------------------------------------------------ euclidean norm
/// \name Euclidean norm calculations
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment