diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-04-15 19:11:42 +0200 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-04-15 19:11:42 +0200 |
| commit | 6d4dbbd5cafce3435ca4c7aae020ba17e5a89b87 (patch) | |
| tree | bcf93a7e475dff5b1a7797a271c94d1a45782c37 /modules/codec/c++/math.hpp | |
| parent | b1a45e4e1c7ef45b95316443f67c8904a9d5b959 (diff) | |
| download | forstio-forstio-6d4dbbd5cafce3435ca4c7aae020ba17e5a89b87.tar.gz | |
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 ){ |
