Trigonometric functions¶
xtensor provides the following trigonometric functions for xexpressions and scalars:
Defined in xtensor/xmath.hpp
-
template<class
E
>
autoxt
::
sin
(E &&e) noexcept -> detail::xfunction_type_t<math::sin_fun, E>¶ Sine function.
Returns an xfunction for the element-wise sine of e (measured in radians).
- Return
an xfunction
- Parameters
e
: an xexpression
-
template<class
E
>
autoxt
::
cos
(E &&e) noexcept -> detail::xfunction_type_t<math::cos_fun, E>¶ Cosine function.
Returns an xfunction for the element-wise cosine of e (measured in radians).
- Return
an xfunction
- Parameters
e
: an xexpression
-
template<class
E
>
autoxt
::
tan
(E &&e) noexcept -> detail::xfunction_type_t<math::tan_fun, E>¶ Tangent function.
Returns an xfunction for the element-wise tangent of e (measured in radians).
- Return
an xfunction
- Parameters
e
: an xexpression
-
template<class
E
>
autoxt
::
asin
(E &&e) noexcept -> detail::xfunction_type_t<math::asin_fun, E>¶ Arcsine function.
Returns an xfunction for the element-wise arcsine of e.
- Return
an xfunction
- Parameters
e
: an xexpression
-
template<class
E
>
autoxt
::
acos
(E &&e) noexcept -> detail::xfunction_type_t<math::acos_fun, E>¶ Arccosine function.
Returns an xfunction for the element-wise arccosine of e.
- Return
an xfunction
- Parameters
e
: an xexpression
-
template<class
E
>
autoxt
::
atan
(E &&e) noexcept -> detail::xfunction_type_t<math::atan_fun, E>¶ Arctangent function.
Returns an xfunction for the element-wise arctangent of e.
- Return
an xfunction
- Parameters
e
: an xexpression
-
template<class
E1
, classE2
>
autoxt
::
atan2
(E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t<math::atan2_fun, E1, E2>¶ Artangent function, using signs to determine quadrants.
Returns an xfunction for the element-wise arctangent of e1 / e2, using the signs of arguments to determine the correct quadrant.
- Return
an xfunction
- Note
e1 and e2 can’t be both scalars.
- Parameters
e1
: an xexpression or a scalare2
: an xexpression or a scalar