HandmadeHero/project/platform/math_constants.hpp

26 lines
966 B
C++
Raw Normal View History

2023-09-13 21:43:35 -07:00
#pragma once
2023-10-06 23:33:39 -07:00
// TODO(Ed) : Make a constant per type?
2023-09-10 16:56:09 -07:00
# define EPSILON 1.19209290e-7f
# define ZERO 0.0f
# define ONE 1.0f
# define TWO_THIRDS 0.666666666666666666666666666666666666667f
# define TAU 6.28318530717958647692528676655900576f
# define PI 3.14159265358979323846264338327950288f
# define ONE_OVER_TAU 0.636619772367581343075535053490057448f
# define ONE_OVER_PI 0.159154943091895335768883763372514362f
# define TAU_OVER_2 3.14159265358979323846264338327950288f
# define TAU_OVER_4 1.570796326794896619231321691639751442f
# define TAU_OVER_8 0.785398163397448309615660845819875721f
2023-09-20 21:26:23 -07:00
# define Euler 2.71828182845904523536f
2023-09-10 16:56:09 -07:00
# define SQRT_TWO 1.41421356237309504880168872420969808f
# define SQRT_THREE 1.73205080756887729352744634150587236f
# define SQRT_FIVE 2.23606797749978969640917366873127623f
# define LOG_TWO 0.693147180559945309417232121458176568f
# define LOG_TEN 2.30258509299404568401799145468436421f