Celeritas  0.5.0-86+4a8eea4
Classes | Typedefs
Turn.hh File Reference
#include <cmath>
#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

using celeritas::Turn = Quantity< TwoPi, real_type >
 Quantity denoting a full turn. More...
 
using celeritas::QuarterTurn = Quantity< HalfPi, int >
 Quantity for an integer number of turns for axis swapping.
 

Functions

CELER_FORCEINLINE_FUNCTION real_type celeritas::sin (Turn r)
 
CELER_FORCEINLINE_FUNCTION real_type celeritas::cos (Turn r)
 
CELER_FORCEINLINE_FUNCTION void celeritas::sincos (Turn r, real_type *sinv, real_type *cosv)
 
CELER_FORCEINLINE_FUNCTION int celeritas::cos (QuarterTurn r)
 
CELER_FORCEINLINE_FUNCTION int celeritas::sin (QuarterTurn r)
 
CELER_FORCEINLINE_FUNCTION void celeritas::sincos (QuarterTurn r, int *sinv, int *cosv)
 

Typedef Documentation

◆ Turn

using celeritas::Turn = typedef Quantity<TwoPi, real_type>

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_FORCEINLINE_FUNCTION int celeritas::cos ( QuarterTurn  r)

Special overrides for math functions for more precise arithmetic

◆ cos() [2/2]

CELER_FORCEINLINE_FUNCTION real_type celeritas::cos ( Turn  r)

Special overrides for math functions for more precise arithmetic

◆ sin() [1/2]

CELER_FORCEINLINE_FUNCTION int celeritas::sin ( QuarterTurn  r)

Special overrides for math functions for more precise arithmetic

◆ sin() [2/2]

CELER_FORCEINLINE_FUNCTION real_type celeritas::sin ( Turn  r)

Special overrides for math functions for more precise arithmetic

◆ sincos() [1/2]

CELER_FORCEINLINE_FUNCTION void celeritas::sincos ( QuarterTurn  r,
int *  sinv,
int *  cosv 
)

Special overrides for math functions for more precise arithmetic

◆ sincos() [2/2]

CELER_FORCEINLINE_FUNCTION void celeritas::sincos ( Turn  r,
real_type sinv,
real_type cosv 
)

Special overrides for math functions for more precise arithmetic