Nugget
Loading...
Searching...
No Matches
Public Member Functions | List of all members
psyqo::Trig< precisionBits > Class Template Reference

A trigonometry table. More...

#include <psyqo/trigonometry.hh>

Public Member Functions

 Trig ()
 
constexpr FixedPoint< precisionBits > cos (Angle a) const
 Calculate the cosine of an angle.
 
constexpr FixedPoint< precisionBits > sin (Angle a) const
 Calculate the sine of an angle.
 

Detailed Description

template<unsigned precisionBits = 12>
class psyqo::Trig< precisionBits >

A trigonometry table.

This is a trigonometry table. It is used to calculate sine and cosine values for angles. It is constructed with a template parameter that specifies the number of bits of precision to use for the table. The default is 12 bits.

Template Parameters
precisionBitsThe number of bits of precision to use for the FixedPoint values in the table.

Constructor & Destructor Documentation

◆ Trig()

template<unsigned precisionBits = 12>
psyqo::Trig< precisionBits >::Trig ( )
inline

Member Function Documentation

◆ cos()

template<unsigned precisionBits = 12>
constexpr FixedPoint< precisionBits > psyqo::Trig< precisionBits >::cos ( Angle  a) const
inlineconstexpr

Calculate the cosine of an angle.

Parameters
aThe angle to calculate the cosine of.
Returns
FixedPoint<precisionBits> The cosine of the angle.

◆ sin()

template<unsigned precisionBits = 12>
constexpr FixedPoint< precisionBits > psyqo::Trig< precisionBits >::sin ( Angle  a) const
inlineconstexpr

Calculate the sine of an angle.

Parameters
aThe angle to calculate the sine of.
Returns
FixedPoint<precisionBits> The sine of the angle.

The documentation for this class was generated from the following file: