Celeritas 0.6.0-dev.116+3fbab5e0
|
#include <cmath>
#include "corecel/Constants.hh"
#include "corecel/Types.hh"
#include "Algorithms.hh"
#include "Quantity.hh"
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. | |
using | celeritas::QuarterTurn = Quantity< HalfPi, int > |
Quantity for an integer number of turns for axis swapping. | |
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 .
CELER_CONSTEXPR_FUNCTION int celeritas::cos | ( | QuarterTurn | r | ) |
Special overrides for math functions for more precise arithmetic
CELER_FORCEINLINE_FUNCTION real_type celeritas::cos | ( | Turn | r | ) |
Special overrides for math functions for more precise arithmetic
CELER_CONSTEXPR_FUNCTION int celeritas::sin | ( | QuarterTurn | r | ) |
Special overrides for math functions for more precise arithmetic
CELER_FORCEINLINE_FUNCTION real_type celeritas::sin | ( | Turn | r | ) |
Special overrides for math functions for more precise arithmetic
CELER_CONSTEXPR_FUNCTION void celeritas::sincos | ( | QuarterTurn | r, |
int * | sinv, | ||
int * | cosv | ||
) |
Special overrides for math functions for more precise arithmetic
CELER_FORCEINLINE_FUNCTION void celeritas::sincos | ( | Turn | r, |
real_type * | sinv, | ||
real_type * | cosv | ||
) |
Special overrides for math functions for more precise arithmetic