# Trigonometric functions¶

## acos function¶

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 code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_INTRINSIC flt_type<T1> acos(const T1& x)
{
return intrinsics::acos(x);
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/asin_acos.hpp#L56

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 code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_INTRINSIC internal::expression_function<fn::acos, E1> acos(E1&& x)
{
return { fn::acos(), std::forward<E1>(x) };
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/asin_acos.hpp#L65

## asin function¶

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 code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_INTRINSIC flt_type<T1> asin(const T1& x)
{
return intrinsics::asin(x);
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/asin_acos.hpp#L39

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 code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_INTRINSIC internal::expression_function<fn::asin, E1> asin(E1&& x)
{
return { fn::asin(), std::forward<E1>(x) };
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/asin_acos.hpp#L48

## atan function¶

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 code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION flt_type<T1> atan(const T1& x)
{
return intrinsics::atan(x);
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/atan.hpp#L40

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 code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::atan, E1> atan(E1&& x)
{
return { fn::atan(), std::forward<E1>(x) };
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/atan.hpp#L49

## atan2 function¶

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 code
template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value)>
KFR_FUNCTION common_type<T1, T2> atan2(const T1& x, const T2& y)
{
return intrinsics::atan2(x, y);
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/atan.hpp#L77

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 code
template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)>
KFR_FUNCTION internal::expression_function<fn::atan2, E1, E2> atan2(E1&& x, E2&& y)
{
return { fn::atan2(), std::forward<E1>(x), std::forward<E2>(y) };
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/atan.hpp#L86

## atan2deg function¶

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 code
template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value)>
KFR_FUNCTION common_type<T1, T2> atan2deg(const T1& x, const T2& y)
{
return intrinsics::atan2deg(x, y);
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/atan.hpp#L96

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 code
template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)>
KFR_FUNCTION internal::expression_function<fn::atan2deg, E1, E2> atan2deg(E1&& x, E2&& y)
{
return { fn::atan2deg(), std::forward<E1>(x), std::forward<E2>(y) };
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/atan.hpp#L105

## atandeg function¶

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 code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION flt_type<T1> atandeg(const T1& x)
{
return intrinsics::atandeg(x);
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/atan.hpp#L59

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 code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::atandeg, E1> atandeg(E1&& x)
{
return { fn::atandeg(), std::forward<E1>(x) };
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/atan.hpp#L68

## cos function¶

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


Returns the trigonometric cosine of x.

Source code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION flt_type<T1> cos(const T1& x)
{
return intrinsics::cos(x);
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L57

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


Returns the trigonometric cosine of x. Accepts and returns expressions.

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::cos, E1> cos(E1&& x)
{
return { fn::cos(), std::forward<E1>(x) };
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L66

## cos2x function¶

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


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

Source code
template <typename T>
KFR_INTRINSIC T cos2x(const T& sinx, const T& cosx)
{
return sqr(cosx) - sqr(sinx);
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L304

## cos3x function¶

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


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

Source code
template <typename T>
KFR_INTRINSIC T cos3x(const T& sinx, const T& cosx)
{
return cosx * (1 - 4 * sqr(sinx));
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L313

## cosdeg function¶

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 code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION flt_type<T1> cosdeg(const T1& x)
{
return intrinsics::cosdeg(x);
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L169

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


Returns the trigonometric cosine of the x (expressed in degrees). Accepts and returns expressions.

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::cosdeg, E1> cosdeg(E1&& x)
{
return { fn::cosdeg(), std::forward<E1>(x) };
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L178

## cossin function¶

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 code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION flt_type<T1> cossin(const T1& x)
{
return intrinsics::cossin(x);
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L132

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


Returns the trigonometric cosine of the even elements of the x and sine of the odd elements. x must be a vector. Accepts and returns expressions.

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::cossin, E1> cossin(E1&& x)
{
return { fn::cossin(), std::forward<E1>(x) };
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L142

## cossindeg function¶

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 code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION flt_type<T1> cossindeg(const T1& x)
{
return intrinsics::cossindeg(x);
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L246

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


Returns the trigonometric cosine of the even elements of the x and sine of the odd elements. x must be expressed in degrees. Accepts and returns expressions.

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::cossindeg, E1> cossindeg(E1&& x)
{
return { fn::cossindeg(), std::forward<E1>(x) };
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L256

## fastcos function¶

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 code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION flt_type<T1> fastcos(const T1& x)
{
return intrinsics::fastcos(x);
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L93

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


Returns an approximation of the trigonometric cosine of x. Accepts and returns expressions.

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::fastcos, E1> fastcos(E1&& x)
{
return { fn::fastcos(), std::forward<E1>(x) };
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L102

## fastcosdeg function¶

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 code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION flt_type<T1> fastcosdeg(const T1& x)
{
return intrinsics::fastcosdeg(x);
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L206

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


Returns an approximation of the trigonometric cosine of the x (expressed in degrees). Accepts and returns expressions.

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::fastcosdeg, E1> fastcosdeg(E1&& x)
{
return { fn::fastcosdeg(), std::forward<E1>(x) };
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L216

## fastsin function¶

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 code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION flt_type<T1> fastsin(const T1& x)
{
return intrinsics::fastsin(x);
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L75

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


Returns an approximation of the trigonometric sine of x. Accepts and returns expressions.

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::fastsin, E1> fastsin(E1&& x)
{
return { fn::fastsin(), std::forward<E1>(x) };
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L84

## fastsindeg function¶

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 code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION flt_type<T1> fastsindeg(const T1& x)
{
return intrinsics::fastsindeg(x);
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L187

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


Returns an approximation of the trigonometric sine of the x (expressed in degrees). Accepts and returns expressions.

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::fastsindeg, E1> fastsindeg(E1&& x)
{
return { fn::fastsindeg(), std::forward<E1>(x) };
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L197

## sin function¶

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


Returns the trigonometric sine of x.

Source code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION flt_type<T1> sin(const T1& x)
{
return intrinsics::sin(x);
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L39

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


Returns the trigonometric sine of x. Accepts and returns expressions.

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::sin, E1> sin(E1&& x)
{
return { fn::sin(), std::forward<E1>(x) };
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L48

## sin2x function¶

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 code
template <typename T>
KFR_INTRINSIC T sin2x(const T& sinx, const T& cosx)
{
return 2 * sinx * cosx;
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L286

## sin3x function¶

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


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

Source code
template <typename T>
KFR_INTRINSIC T sin3x(const T& sinx, const T& cosx)
{
return sinx * (-1 + 4 * sqr(cosx));
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L295

## sinc function¶

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 code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION flt_type<T1> sinc(const T1& x)
{
return intrinsics::sinc(x);
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L268

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


Returns the sinc function of x. Accepts and returns expressions.

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::sinc, E1> sinc(E1&& x)
{
return { fn::sinc(), std::forward<E1>(x) };
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L277

## sincos function¶

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 code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION flt_type<T1> sincos(const T1& x)
{
return intrinsics::sincos(x);
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L112

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


Returns the trigonometric sine of the even elements of the x and cosine of the odd elements. x must be a vector. Accepts and returns expressions.

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::sincos, E1> sincos(E1&& x)
{
return { fn::sincos(), std::forward<E1>(x) };
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L122

## sincosdeg function¶

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 code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION flt_type<T1> sincosdeg(const T1& x)
{
return intrinsics::sincosdeg(x);
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L226

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


Returns the trigonometric sine of the even elements of the x and cosine of the odd elements. x must be expressed in degrees. Accepts and returns expressions.

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::sincosdeg, E1> sincosdeg(E1&& x)
{
return { fn::sincosdeg(), std::forward<E1>(x) };
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L236

## sindeg function¶

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 code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>::value)>
KFR_FUNCTION flt_type<T1> sindeg(const T1& x)
{
return intrinsics::sindeg(x);
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L151

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


Returns the trigonometric sine of the x (expressed in degrees). Accepts and returns expressions.

Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>::value)>
KFR_FUNCTION internal::expression_function<fn::sindeg, E1> sindeg(E1&& x)
{
return { fn::sindeg(), std::forward<E1>(x) };
}


https://github.com/kfrlib/kfr/blob//include/kfr/math/sin_cos.hpp#L160

Auto-generated from sources, Revision , https://github.com/kfrlib/kfr/blob//include/kfr/