|
Celeritas 0.7.0-dev.195+develop.9f96e13e6
|
#include <cmath>#include <cstdlib>#include <type_traits>#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 | |
| 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< T > | celeritas::make_turn (T value) |
| Create a turn using template deduction. | |
| template<class T > | |
| CELER_FORCEINLINE_FUNCTION Turn_t< T > | celeritas::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 T | celeritas::tan (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) |
| 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 .
| CELER_CONSTEXPR_FUNCTION int celeritas::cos | ( | IntQuarterTurn | r | ) |
Special overrides for math functions for more precise arithmetic
| CELER_FORCEINLINE_FUNCTION T celeritas::cos | ( | Turn_t< T > | r | ) |
Special overrides for math functions for more precise arithmetic
| CELER_CONSTEXPR_FUNCTION int celeritas::sin | ( | IntQuarterTurn | r | ) |
Special overrides for math functions for more precise arithmetic
| CELER_FORCEINLINE_FUNCTION T celeritas::sin | ( | Turn_t< T > | r | ) |
Special overrides for math functions for more precise arithmetic
| CELER_CONSTEXPR_FUNCTION void celeritas::sincos | ( | IntQuarterTurn | r, |
| int * | sinv, | ||
| int * | cosv | ||
| ) |
Special overrides for math functions for more precise arithmetic
| CELER_FORCEINLINE_FUNCTION void celeritas::sincos | ( | Turn_t< T > | r, |
| T * | sinv, | ||
| T * | cosv | ||
| ) |
Special overrides for math functions for more precise arithmetic
| CELER_FORCEINLINE_FUNCTION T celeritas::tan | ( | Turn_t< T > | r | ) |
Special overrides for math functions for more precise arithmetic