diff --git a/coord/ops.hpp b/coord/ops.hpp index e63d3898..286fe61f 100644 --- a/coord/ops.hpp +++ b/coord/ops.hpp @@ -565,6 +565,50 @@ namespace util { return k; } + /////////////////////////////////////////////////////////////////////////// + // trigonometric functions + template < + size_t S, + typename T, + template class K, + typename = std::enable_if_t,void> + > + constexpr + K + sin (K k) + { + std::transform ( + std::cbegin (k), + std::cend (k), + std::begin (k), + [] (auto v) { return std::sin (v); } + ); + + return k; + } + + + //------------------------------------------------------------------------- + template < + size_t S, + typename T, + template class K, + typename = std::enable_if_t,void> + > + constexpr + K + cos (K k) + { + std::transform ( + std::cbegin (k), + std::cend (k), + std::begin (k), + [] (auto v) { return std::cos (v); } + ); + + return k; + } + /////////////////////////////////////////////////////////////////////////// // logical element operators