KFR

Trigonometric functions

asin

template<typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
flt_type<T1> asin(const T1 &x)

Returns the arc sine of x. The returned angle is in the range \(-\pi/2\) through \(\pi/2\).

Source:

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_INTRIN flt_type<T1> asin(const T1& x)
template<typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::asin, E1> asin(E1 &&x)

Returns template expression that returns the arc sine of x.

Source:

template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_INTRIN internal::expression_function<fn::asin, E1> asin(E1&& x)

acos

template<typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
flt_type<T1> acos(const T1 &x)

Returns the arc cosine of x. The returned angle is in the range 0 through \(\pi\).

Source:

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_INTRIN flt_type<T1> acos(const T1& x)
template<typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::acos, E1> acos(E1 &&x)

Returns template expression that returns the arc cosine of x.

Source:

template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_INTRIN internal::expression_function<fn::acos, E1> acos(E1&& x)

atan

template<typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
flt_type<T1> atan(const T1 &x)

Returns the arc tangent of x. The returned angle is in the range \(-\pi/2\) through

\(\pi/2\).

Source:

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNC flt_type<T1> atan(const T1& x)
template<typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::atan, E1> atan(E1 &&x)

Returns template expression that returns the arc tangent of x.

Source:

template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNC internal::expression_function<fn::atan, E1> atan(E1&& x)

atandeg

template<typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
flt_type<T1> atandeg(const T1 &x)

Returns the arc tangent of the x, expressed in degrees. The returned angle is in the range -90

through 90.

Source:

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNC flt_type<T1> atandeg(const T1& x)
template<typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::atandeg, E1> atandeg(E1 &&x)

Returns template expression that returns the arc tangent of the x, expressed in degrees.

Source:

template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNC internal::expression_function<fn::atandeg, E1> atandeg(E1&& x)

atan2

template<typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value)>
common_type<T1, T2> atan2(const T1 &x, const T2 &y)

Returns the arc tangent of y/x using the signs of arguments to determine the correct quadrant.

Source:

template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value)>
KFR_FUNC common_type<T1, T2> atan2(const T1& x, const T2& y)
template<typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)>
internal::expression_function<fn::atan2, E1, E2> atan2(E1 &&x, E2 &&y)

Returns template expression that returns the arc tangent of y/x.

Source:

template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)>
KFR_FUNC internal::expression_function<fn::atan2, E1, E2> atan2(E1&& x, E2&& y)

atan2deg

template<typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value)>
common_type<T1, T2> atan2deg(const T1 &x, const T2 &y)

Returns the arc tangent of y/x (expressed in degrees) using the signs of arguments to determine the

correct quadrant.

Source:

template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value)>
KFR_FUNC common_type<T1, T2> atan2deg(const T1& x, const T2& y)
template<typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)>
internal::expression_function<fn::atan2deg, E1, E2> atan2deg(E1 &&x, E2 &&y)

Returns template expression that returns the arc tangent of y/x (expressed in degrees).

Source:

template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)>
KFR_FUNC internal::expression_function<fn::atan2deg, E1, E2> atan2deg(E1&& x, E2&& y)

sin

template<typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
flt_type<T1> sin(const T1 &x)

Returns the trigonometric sine of x.

Source:

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNC flt_type<T1> sin(const T1& x)
template<typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::sin, E1> sin(E1 &&x)

Returns template expression that returns the trigonometric sine of x.

Source:

template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNC internal::expression_function<fn::sin, E1> sin(E1&& x)

cos

template<typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
flt_type<T1> cos(const T1 &x)

Returns the trigonometric cosine of x.

Source:

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNC flt_type<T1> cos(const T1& x)
template<typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::cos, E1> cos(E1 &&x)

Returns template expression that returns the trigonometric cosine of x.

Source:

template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNC internal::expression_function<fn::cos, E1> cos(E1&& x)

fastsin

template<typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
flt_type<T1> fastsin(const T1 &x)

Returns an approximation of the trigonometric sine of x.

Source:

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNC flt_type<T1> fastsin(const T1& x)
template<typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::fastsin, E1> fastsin(E1 &&x)

Returns template expression that returns an approximation of the trigonometric sine of x.

Source:

template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNC internal::expression_function<fn::fastsin, E1> fastsin(E1&& x)

fastcos

template<typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
flt_type<T1> fastcos(const T1 &x)

Returns an approximation of the trigonometric cosine of x.

Source:

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNC flt_type<T1> fastcos(const T1& x)
template<typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::fastcos, E1> fastcos(E1 &&x)

Returns template expression that returns an approximation of the trigonometric cosine of x.

Source:

template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNC internal::expression_function<fn::fastcos, E1> fastcos(E1&& x)

sincos

template<typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
flt_type<T1> sincos(const T1 &x)

Returns the trigonometric sine of the even elements of the x and cosine of the odd elements. x must

be a vector.

Source:

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNC flt_type<T1> sincos(const T1& x)
template<typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::sincos, E1> sincos(E1 &&x)

Returns template expression that returns the trigonometric sine of the even elements of the x and

cosine of the odd elements. x must be a vector.

Source:

template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNC internal::expression_function<fn::sincos, E1> sincos(E1&& x)

cossin

template<typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
flt_type<T1> cossin(const T1 &x)

Returns the trigonometric cosine of the even elements of the x and sine of the odd elements. x must

be a vector.

Source:

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNC flt_type<T1> cossin(const T1& x)
template<typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::cossin, E1> cossin(E1 &&x)

Returns template expression that returns the trigonometric cosine of the even elements of the x and

sine of the odd elements. x must be a vector.

Source:

template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNC internal::expression_function<fn::cossin, E1> cossin(E1&& x)

sindeg

template<typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
flt_type<T1> sindeg(const T1 &x)

Returns the trigonometric sine of the x (expressed in degrees).

Source:

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNC flt_type<T1> sindeg(const T1& x)
template<typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::sindeg, E1> sindeg(E1 &&x)

Returns template expression that returns the trigonometric sine of the x (expressed in degrees).

Source:

template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNC internal::expression_function<fn::sindeg, E1> sindeg(E1&& x)

cosdeg

template<typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
flt_type<T1> cosdeg(const T1 &x)

Returns the trigonometric cosine of the x (expressed in degrees).

Source:

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNC flt_type<T1> cosdeg(const T1& x)
template<typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::cosdeg, E1> cosdeg(E1 &&x)

Returns template expression that returns the trigonometric cosine of the x (expressed in degrees).

Source:

template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNC internal::expression_function<fn::cosdeg, E1> cosdeg(E1&& x)

fastsindeg

template<typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
flt_type<T1> fastsindeg(const T1 &x)

Returns an approximation of the trigonometric sine of the x (expressed in degrees).

Source:

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNC flt_type<T1> fastsindeg(const T1& x)
template<typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::fastsindeg, E1> fastsindeg(E1 &&x)

Returns template expression that returns an approximation of the trigonometric sine of the x

(expressed in degrees).

Source:

template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNC internal::expression_function<fn::fastsindeg, E1> fastsindeg(E1&& x)

fastcosdeg

template<typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
flt_type<T1> fastcosdeg(const T1 &x)

Returns an approximation of the trigonometric cosine of the x (expressed in degrees).

Source:

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNC flt_type<T1> fastcosdeg(const T1& x)
template<typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::fastcosdeg, E1> fastcosdeg(E1 &&x)

Returns template expression that returns an approximation of the trigonometric cosine of the x

(expressed in degrees).

Source:

template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNC internal::expression_function<fn::fastcosdeg, E1> fastcosdeg(E1&& x)

sincosdeg

template<typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
flt_type<T1> sincosdeg(const T1 &x)

Returns the trigonometric sine of the even elements of the x and cosine of the odd elements. x must

be a vector and expressed in degrees.

Source:

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNC flt_type<T1> sincosdeg(const T1& x)
template<typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::sincosdeg, E1> sincosdeg(E1 &&x)

Returns template expression that returns the trigonometric sine of the even elements of the x and

cosine of the odd elements. x must be expressed in degrees.

Source:

template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNC internal::expression_function<fn::sincosdeg, E1> sincosdeg(E1&& x)

cossindeg

template<typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
flt_type<T1> cossindeg(const T1 &x)

Returns the trigonometric cosine of the even elements of the x and sine of the odd elements. x must

be a vector and expressed in degrees.

Source:

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNC flt_type<T1> cossindeg(const T1& x)
template<typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::cossindeg, E1> cossindeg(E1 &&x)

Returns template expression that returns the trigonometric cosine of the even elements of the x and

sine of the odd elements. x must be expressed in degrees.

Source:

template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNC internal::expression_function<fn::cossindeg, E1> cossindeg(E1&& x)

sinc

template<typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
flt_type<T1> sinc(const T1 &x)

Returns the sinc function of x.

\[sinc(x) = \frac{sin(x)}{x}\]

Source:

template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNC flt_type<T1> sinc(const T1& x)
template<typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
internal::expression_function<fn::sinc, E1> sinc(E1 &&x)

Returns template expression that returns the sinc function of x.

Source:

template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNC internal::expression_function<fn::sinc, E1> sinc(E1&& x)

sin2x

template<typename T>
T sin2x(const T &sinx, const T &cosx)

Returns the trigonometric sine of the angle 2x using sin(x) and cos(x).

Source:

template <typename T>
KFR_SINTRIN T sin2x(const T& sinx, const T& cosx)

sin3x

template<typename T>
T sin3x(const T &sinx, const T &cosx)

Returns the trigonometric sine of the angle 3x using sin(x) and cos(x).

Source:

template <typename T>
KFR_SINTRIN T sin3x(const T& sinx, const T& cosx)

cos2x

template<typename T>
T cos2x(const T &sinx, const T &cosx)

Returns the trigonometric cosine of the angle 2x using sin(x) and cos(x).

Source:

template <typename T>
KFR_SINTRIN T cos2x(const T& sinx, const T& cosx)

cos3x

template<typename T>
T cos3x(const T &sinx, const T &cosx)

Returns the trigonometric cosine of the angle 3x using sin(x) and cos(x).

Source:

template <typename T>
KFR_SINTRIN T cos3x(const T& sinx, const T& cosx)