opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
trigonometric_functions.h
Go to the documentation of this file.
1#pragma once
2
6
7#include <cmath>
8#include <concepts>
9
10namespace osc
11{
12 template<std::floating_point GenType>
14 {
15 return std::sin(v);
16 }
17
18 template<std::floating_point Rep, AngularUnitTraits Units>
20
21 template<std::floating_point T, size_t N>
23 {
24 return map(v, sin<T>);
25 }
26
27 template<std::floating_point Rep, AngularUnitTraits Units, size_t N>
29 {
30 return map(v, sin<Rep, Units>);
31 }
32
33 template<std::floating_point GenType>
35 {
36 return std::cos(v);
37 }
38
39 template<std::floating_point Rep, AngularUnitTraits Units>
41 {
42 return cos(RadiansT<Rep>{v}.count());
43 }
44
45 template<std::floating_point T, size_t N>
47 {
48 return map(v, cos<T>);
49 }
50
51 template<std::floating_point Rep, AngularUnitTraits Units, size_t N>
53 {
54 return map(v, cos<Rep, Units>);
55 }
56
57 template<std::floating_point GenType>
59 {
60 return std::tan(v);
61 }
62
63 template<std::floating_point Rep, AngularUnitTraits Units>
65 {
66 return tan(RadiansT<Rep>{v}.count());
67 }
68
69 template<std::floating_point T, size_t N>
71 {
72 return map(v, tan<T>);
73 }
74
75 template<std::floating_point Rep, AngularUnitTraits Units, size_t N>
77 {
78 return map(v, tan<Rep, Units>);
79 }
80
81 template<std::floating_point Rep>
83 {
84 return RadiansT<Rep>{std::atan(v)};
85 }
86
87 template<std::floating_point Rep>
89 {
90 return RadiansT<Rep>{std::acos(num)};
91 }
92
93 template<std::floating_point Rep>
95 {
96 return RadiansT<Rep>{std::asin(num)};
97 }
98
99 template<std::floating_point Rep>
100 RadiansT<Rep> atan2(Rep x, Rep y)
101 {
102 return RadiansT<Rep>{std::atan2(x, y)};
103 }
104}
Definition angle.h:25
constexpr Rep count() const
Definition angle.h:50
Definition vector.h:63
Definition custom_decoration_generator.h:5
GenType cos(GenType v)
Definition trigonometric_functions.h:34
constexpr auto map(const Rgba< T > &x, UnaryOperation op) -> Rgba< decltype(std::invoke(op, x[0]))>
Definition rgba.h:208
constexpr U to(T &&value)
Definition conversion.h:56
GenType sin(GenType v)
Definition trigonometric_functions.h:13
RadiansT< Rep > acos(Rep num)
Definition trigonometric_functions.h:88
RadiansT< Rep > atan2(Rep x, Rep y)
Definition trigonometric_functions.h:100
GenType tan(GenType v)
Definition trigonometric_functions.h:58
RadiansT< Rep > asin(Rep num)
Definition trigonometric_functions.h:94
RadiansT< Rep > atan(Rep v)
Definition trigonometric_functions.h:82