Trigonometric functions

xtensor provides the following trigonometric functions for xexpressions and scalars:

Defined in xtensor/core/xmath.hpp

template<class E>
inline detail::xfunction_type_t<math::sin_fun, E> sin(E &&e) noexcept

Sine function.

Returns an xfunction for the element-wise sine of e (measured in radians).

Parameters:

e – an xexpression

Returns:

an xfunction

template<class E>
inline detail::xfunction_type_t<math::cos_fun, E> cos(E &&e) noexcept

Cosine function.

Returns an xfunction for the element-wise cosine of e (measured in radians).

Parameters:

e – an xexpression

Returns:

an xfunction

template<class E>
inline detail::xfunction_type_t<math::tan_fun, E> tan(E &&e) noexcept

Tangent function.

Returns an xfunction for the element-wise tangent of e (measured in radians).

Parameters:

e – an xexpression

Returns:

an xfunction

template<class E>
inline detail::xfunction_type_t<math::asin_fun, E> asin(E &&e) noexcept

Arcsine function.

Returns an xfunction for the element-wise arcsine of e.

Parameters:

e – an xexpression

Returns:

an xfunction

template<class E>
inline detail::xfunction_type_t<math::acos_fun, E> acos(E &&e) noexcept

Arccosine function.

Returns an xfunction for the element-wise arccosine of e.

Parameters:

e – an xexpression

Returns:

an xfunction

template<class E>
inline detail::xfunction_type_t<math::atan_fun, E> atan(E &&e) noexcept

Arctangent function.

Returns an xfunction for the element-wise arctangent of e.

Parameters:

e – an xexpression

Returns:

an xfunction

template<class E1, class E2>
inline detail::xfunction_type_t<math::atan2_fun, E1, E2> atan2(E1 &&e1, E2 &&e2) noexcept

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.

Note

e1 and e2 can’t be both scalars.

Parameters:
Returns:

an xfunction