charcoal/OpenGLEngine/constants.h

43 lines
1.3 KiB
C
Raw Normal View History

#pragma once
#define DEG_TO_RAD(x) x * egm::TAU_1_360;
#define RAD_TO_DEG(x)
2018-09-12 21:03:46 +00:00
namespace charcoal
{
// 2PI = TAU: 6.2831853071795864769252867665590
// 6.28318530717958647693
const double TAU = 6.28318530717958647693;
// 5.49778714378213816731
const double TAU_7_8 = 5.49778714378213816731;
// 4.71238898038468985769
const double TAU_3_4 = 4.71238898038468985769;
// 3.92699081698724154808
const double TAU_5_8 = 3.92699081698724154808;
// 3.14159265358979323846
const double TAU_1_2 = 3.14159265358979323846;
// 2.35619449019234492885
const double TAU_3_8 = 2.35619449019234492885;
// 1.57079632679489661923
const double TAU_1_4 = 1.57079632679489661923;
// 0.78539816339744830962
const double TAU_1_8 = 0.78539816339744830962;
// 0.01745329251994329577
const double TAU_1_360 = 0.01745329251994329577;
// 360 deg / TAU:
const double DEG_360_1_TAU = 57.2957795130823208768;
// Alternate Names
const double PI_2_1 = TAU;
const double PI_7_4 = TAU_7_8;
const double PI_3_2 = TAU_3_4;
const double PI_5_4 = TAU_5_8;
const double PI = TAU_1_2;
const double PI_3_4 = TAU_3_8;
const double PI_1_2 = TAU_1_4;
const double PI_1_4 = TAU_1_8;
inline double radians(double degrees) { return degrees * TAU_1_360; }
inline double degrees(double radians) { return radians * DEG_360_1_TAU; }
}