45constexpr double PI = 3.14159265358979323846;
49constexpr double KmInAu = 149597870.700;
52constexpr double G = 6.6743015e-11;
54constexpr double G_km = 6.6743015e-20;
57constexpr double SunMu = 1.32712400188e11;
59#if __cplusplus == 202302L
61#define floatmod std::fmod
63inline double constexpr floatmod(
double x,
double y) {
return x - y * (int)(x / y); }
80 if (r < 0) r +=
TWOPI;
101inline constexpr double operator""_au(
const long double au) {
return toKm(au); }
Definition: coordinates.cpp:22
constexpr degree toDegree(radian theta)
Definition: units.h:98
constexpr astronomical_unit LtyrtoAU(light_year ltyr)
Definition: units.h:95
double second
Definition: units.h:42
double earth_masses
Definition: units.h:40
UnitType
Definition: units.h:22
@ Mass
Definition: units.h:25
@ Time
Definition: units.h:27
@ Volume
Definition: units.h:26
@ Angle
Definition: units.h:24
Distance
Definition: units.h:30
@ Millimeter
Definition: units.h:30
@ AstronomicalUnit
Definition: units.h:30
@ LightYear
Definition: units.h:30
@ Centimeter
Definition: units.h:30
@ Kilometer
Definition: units.h:30
@ Meter
Definition: units.h:30
constexpr double G
Definition: units.h:52
constexpr double KmInAu
Definition: units.h:49
constexpr double SunMu
Definition: units.h:57
double kilogram
Definition: units.h:39
double kilometer
Definition: units.h:34
constexpr double floatmod(double x, double y)
Definition: units.h:63
double joule
Definition: units.h:41
double radian
Definition: units.h:37
constexpr radian toRadian(degree theta)
Definition: units.h:97
constexpr radian normalize_radian(const radian &radian)
Normalizes a radian to [0, PI*2)
Definition: units.h:70
constexpr double TWOPI
Definition: units.h:46
double light_year
Definition: units.h:33
constexpr kilometer toKm(astronomical_unit au)
Definition: units.h:96
constexpr double PI
Definition: units.h:45
double degree
Definition: units.h:36
double solar_mass
Definition: units.h:35
constexpr astronomical_unit toAU(kilometer km)
Definition: units.h:93
constexpr light_year toLightYear(astronomical_unit au)
Definition: units.h:94
constexpr degree normalize_degree(const degree &radian)
Definition: units.h:84
double meter_cube
Definition: units.h:38
constexpr double G_km
Definition: units.h:54
constexpr double normalize_radian_coord(const radian &radian)
Definition: units.h:78
double astronomical_unit
Definition: units.h:32
constexpr double HALFPI
Definition: units.h:47