diff options
Diffstat (limited to 'modules/codec/c++/math.hpp')
| -rw-r--r-- | modules/codec/c++/math.hpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/codec/c++/math.hpp b/modules/codec/c++/math.hpp index 2ce8333..1d627e6 100644 --- a/modules/codec/c++/math.hpp +++ b/modules/codec/c++/math.hpp @@ -141,6 +141,21 @@ data<schema::Scalar<T>,Encoding> cross( } template<typename T, typename Encoding = FORSTIO_DEFAULT_DATA_ENCODING> +data<schema::Vector<T,2u>,Encoding> cross( + const data<schema::Scalar<T>, Encoding> lh, + const data<schema::Vector<T,2u>, Encoding> rh +){ + data<schema::Vector<T,2u>, Encoding> cross_prod; + + cross_prod.at({{0u}}) = lh.at({}) * rh.at({{1u}}) * -1; + cross_prod.at({{1u}}) = lh.at({}) * rh.at({{0u}}); + + return cross_prod; +} + + + +template<typename T, typename Encoding = FORSTIO_DEFAULT_DATA_ENCODING> data<schema::Scalar<T>,Encoding> cos( const data<schema::Scalar<T>,Encoding>& val ){ |
