WPILibC++ 2023.4.3
cos.hpp File Reference

Go to the source code of this file.

Namespaces

namespace  internal
 

Functions

template<typename T >
constexpr T internal::cos_compute (const T x) noexcept
 
template<typename T >
constexpr T internal::cos_check (const T x) noexcept
 
template<typename T >
constexpr return_t< T > cos (const T x) noexcept
 Compile-time cosine function. More...
 

Function Documentation

◆ cos()

template<typename T >
constexpr return_t< T > cos ( const T  x)
constexprnoexcept

Compile-time cosine function.

Parameters
xa real-valued input.
Returns
the cosine function using

\[ \cos(x) = \frac{1-\tan^2(x/2)}{1+\tan^2(x/2)} \]