summaryrefslogtreecommitdiff
path: root/modules/codec/c++/math.hpp
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2026-04-15 19:11:42 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2026-04-15 19:11:42 +0200
commit6d4dbbd5cafce3435ca4c7aae020ba17e5a89b87 (patch)
treebcf93a7e475dff5b1a7797a271c94d1a45782c37 /modules/codec/c++/math.hpp
parentb1a45e4e1c7ef45b95316443f67c8904a9d5b959 (diff)
downloadforstio-forstio-6d4dbbd5cafce3435ca4c7aae020ba17e5a89b87.tar.gz
Dangling changes and added cross productHEADmasterdev
Diffstat (limited to 'modules/codec/c++/math.hpp')
-rw-r--r--modules/codec/c++/math.hpp15
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
){