Celeritas 0.6.0-rc.2.13+develop.285b9112
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
Turn.hh File Reference
#include <cmath>
#include <type_traits>
#include "corecel/Constants.hh"
#include "corecel/Types.hh"
#include "Algorithms.hh"
#include "Quantity.hh"
This graph shows which files directly or indirectly include this file:

Classes

struct  celeritas::TwoPi
 Unit for 2*pi radians. More...
 
struct  celeritas::HalfPi
 Unit for pi/2 radians. More...
 

Typedefs

template<class T >
using celeritas::Turn_t = Quantity< TwoPi, T >
 Quantity denoting a full turn.
 
using celeritas::Turn = Turn_t< real_type >
 Turn with default precision (DEPRECATEDish)
 
using celeritas::RealTurn = Turn_t< real_type >
 Turn with default precision.
 
using celeritas::QuarterTurn = Quantity< HalfPi, int >
 Quantity for an integer number of turns for axis swapping (DEPRECATEDish)
 
using celeritas::IntQuarterTurn = Quantity< HalfPi, int >
 Quantity for an integer number of turns for axis swapping.
 

Functions

template<class T >
CELER_CONSTEXPR_FUNCTION Turn_t< Tceleritas::make_turn (T value)
 Create a turn using template deduction.
 
template<class T >
CELER_FORCEINLINE_FUNCTION Turn_t< Tceleritas::atan2turn (T y, T x)
 Math functions that return turns from types.
 
template<class T >
CELER_FORCEINLINE_FUNCTION T celeritas::sin (Turn_t< T > r)
 
template<class T >
CELER_FORCEINLINE_FUNCTION T celeritas::cos (Turn_t< T > r)
 
template<class T >
CELER_FORCEINLINE_FUNCTION void celeritas::sincos (Turn_t< T > r, T *sinv, T *cosv)
 
CELER_CONSTEXPR_FUNCTION int celeritas::cos (IntQuarterTurn r)
 
CELER_CONSTEXPR_FUNCTION int celeritas::sin (IntQuarterTurn r)
 
CELER_CONSTEXPR_FUNCTION void celeritas::sincos (IntQuarterTurn r, int *sinv, int *cosv)
 

Typedef Documentation

◆ Turn_t

template<class T >
using celeritas::Turn_t = typedef Quantity<TwoPi, T>

Quantity denoting a full turn.

Turns are a useful way of representing angles without the historical arbitrariness of degrees or the roundoff errors of radians. See, for example, https://www.computerenhance.com/p/turns-are-better-than-radians .

Function Documentation

◆ cos() [1/2]

CELER_CONSTEXPR_FUNCTION int celeritas::cos ( IntQuarterTurn  r)

Special overrides for math functions for more precise arithmetic

◆ cos() [2/2]

template<class T >
CELER_FORCEINLINE_FUNCTION T celeritas::cos ( Turn_t< T r)

Special overrides for math functions for more precise arithmetic

◆ sin() [1/2]

CELER_CONSTEXPR_FUNCTION int celeritas::sin ( IntQuarterTurn  r)

Special overrides for math functions for more precise arithmetic

◆ sin() [2/2]

template<class T >
CELER_FORCEINLINE_FUNCTION T celeritas::sin ( Turn_t< T r)

Special overrides for math functions for more precise arithmetic

◆ sincos() [1/2]

CELER_CONSTEXPR_FUNCTION void celeritas::sincos ( IntQuarterTurn  r,
int sinv,
int cosv 
)

Special overrides for math functions for more precise arithmetic

◆ sincos() [2/2]

template<class T >
CELER_FORCEINLINE_FUNCTION void celeritas::sincos ( Turn_t< T r,
T sinv,
T cosv 
)

Special overrides for math functions for more precise arithmetic