coord/ops: add simple cosine wrapper

This commit is contained in:
Danny Robson 2018-03-12 23:04:17 +11:00
parent 92de21982a
commit d1c6df8bf1

View File

@ -1391,7 +1391,27 @@ namespace std {
return v;
}
};
template <
typename CoordT,
typename = std::enable_if_t<
::util::is_coord_v<CoordT>, void
>
>
auto cos (CoordT val)
{
CoordT out;
std::transform (
std::begin (val),
std::end (val),
std::begin (out),
[] (auto i) { return ::std::cos (i); }
);
return out;
}
};
#endif