21template <JanusScalar T> T
sin(
const T &x) {
22 if constexpr (std::is_floating_point_v<T>) {
35template <
typename Derived>
auto sin(
const Eigen::MatrixBase<Derived> &x) {
36 return x.array().sin().matrix();
46template <JanusScalar T> T
cos(
const T &x) {
47 if constexpr (std::is_floating_point_v<T>) {
60template <
typename Derived>
auto cos(
const Eigen::MatrixBase<Derived> &x) {
61 return x.array().cos().matrix();
71template <JanusScalar T> T
tan(
const T &x) {
72 if constexpr (std::is_floating_point_v<T>) {
85template <
typename Derived>
auto tan(
const Eigen::MatrixBase<Derived> &x) {
86 return x.array().tan().matrix();
96template <JanusScalar T> T
asin(
const T &x) {
97 if constexpr (std::is_floating_point_v<T>) {
110template <
typename Derived>
auto asin(
const Eigen::MatrixBase<Derived> &x) {
111 return x.array().asin().matrix();
121template <JanusScalar T> T
acos(
const T &x) {
122 if constexpr (std::is_floating_point_v<T>) {
135template <
typename Derived>
auto acos(
const Eigen::MatrixBase<Derived> &x) {
136 return x.array().acos().matrix();
146template <JanusScalar T> T
atan(
const T &x) {
147 if constexpr (std::is_floating_point_v<T>) {
160template <
typename Derived>
auto atan(
const Eigen::MatrixBase<Derived> &x) {
161 return x.array().atan().matrix();
172template <JanusScalar T> T
atan2(
const T &y,
const T &x) {
173 if constexpr (std::is_floating_point_v<T>) {
174 return std::atan2(y, x);
187template <JanusScalar T> T
asinh(
const T &x) {
188 if constexpr (std::is_floating_point_v<T>) {
189 return std::asinh(x);
201template <
typename Derived>
auto asinh(
const Eigen::MatrixBase<Derived> &x) {
202 using Scalar =
typename Derived::Scalar;
203 if constexpr (std::is_same_v<Scalar, casadi::MX>) {
204 return x.unaryExpr([](
const Scalar &v) {
return asinh(v); });
206 return x.array().asinh().matrix();
217template <JanusScalar T> T
acosh(
const T &x) {
218 if constexpr (std::is_floating_point_v<T>) {
219 return std::acosh(x);
231template <
typename Derived>
auto acosh(
const Eigen::MatrixBase<Derived> &x) {
232 using Scalar =
typename Derived::Scalar;
233 if constexpr (std::is_same_v<Scalar, casadi::MX>) {
234 return x.unaryExpr([](
const Scalar &v) {
return acosh(v); });
236 return x.array().acosh().matrix();
247template <JanusScalar T> T
atanh(
const T &x) {
248 if constexpr (std::is_floating_point_v<T>) {
249 return std::atanh(x);
261template <
typename Derived>
auto atanh(
const Eigen::MatrixBase<Derived> &x) {
262 using Scalar =
typename Derived::Scalar;
263 if constexpr (std::is_same_v<Scalar, casadi::MX>) {
264 return x.unaryExpr([](
const Scalar &v) {
return atanh(v); });
266 return x.array().atanh().matrix();
C++20 concepts constraining valid Janus scalar types.
Definition Diagnostics.hpp:19
T atan(const T &x)
Computes arc tangent of x.
Definition Trig.hpp:146
T acos(const T &x)
Computes arc cosine of x.
Definition Trig.hpp:121
T tan(const T &x)
Computes tangent of x.
Definition Trig.hpp:71
T cos(const T &x)
Computes cosine of x.
Definition Trig.hpp:46
T asin(const T &x)
Computes arc sine of x.
Definition Trig.hpp:96
T sin(const T &x)
Computes sine of x.
Definition Trig.hpp:21
T asinh(const T &x)
Computes inverse hyperbolic sine of x.
Definition Trig.hpp:187
T atanh(const T &x)
Computes inverse hyperbolic tangent of x.
Definition Trig.hpp:247
T acosh(const T &x)
Computes inverse hyperbolic cosine of x.
Definition Trig.hpp:217
T atan2(const T &y, const T &x)
Computes arc tangent of y/x using signs of both arguments.
Definition Trig.hpp:172