From 0624a3ad00e3dd2cdf7fb02ffa9c26a7a66d52b1 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Wed, 18 Dec 2019 10:52:10 +1100 Subject: [PATCH] coord: add to_radians for vector --- coord/ops.hpp | 15 +++++++++++++++ vector.hpp | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/coord/ops.hpp b/coord/ops.hpp index 5f7dbe91..e6cf7c1a 100644 --- a/coord/ops.hpp +++ b/coord/ops.hpp @@ -1476,6 +1476,21 @@ namespace cruft { std::fill_n (std::begin (res) + K::elements - places, places, fill); return res; } + + + //------------------------------------------------------------------------- + template < + std::size_t S, + typename T + > + vector + to_radians (vector const &val) + { + return ::cruft::invoke> ( + ::cruft::sin, + val + ); + } }; diff --git a/vector.hpp b/vector.hpp index ed224485..05181fc3 100644 --- a/vector.hpp +++ b/vector.hpp @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2011-2017 Danny Robson + * Copyright 2011-2019 Danny Robson */ #ifndef CRUFT_UTIL_VECTOR_HPP