55 lines
No EOL
1.3 KiB
HLSL
55 lines
No EOL
1.3 KiB
HLSL
/*
|
|
contributors: Patricio Gonzalez Vivo
|
|
description: some useful math constants
|
|
license:
|
|
- Copyright (c) 2021 Patricio Gonzalez Vivo under Prosperity License - https://prosperitylicense.com/versions/3.0.0
|
|
- Copyright (c) 2021 Patricio Gonzalez Vivo under Patron License - https://lygia.xyz/license
|
|
*/
|
|
#ifndef EIGHTH_PI
|
|
#define EIGHTH_PI 0.39269908169
|
|
#endif
|
|
#ifndef QTR_PI
|
|
#define QTR_PI 0.78539816339
|
|
#endif
|
|
#ifndef HALF_PI
|
|
#define HALF_PI 1.5707963267948966192313216916398
|
|
#endif
|
|
#ifndef PI
|
|
#define PI 3.1415926535897932384626433832795
|
|
#endif
|
|
#ifndef TWO_PI
|
|
#define TWO_PI 6.2831853071795864769252867665590
|
|
#endif
|
|
#ifndef TAU
|
|
#define TAU 6.2831853071795864769252867665590
|
|
#endif
|
|
#ifndef INV_PI
|
|
#define INV_PI 0.31830988618379067153776752674503
|
|
#endif
|
|
#ifndef INV_SQRT_TAU
|
|
#define INV_SQRT_TAU 0.39894228040143267793994605993439 // 1.0/SQRT_TAU
|
|
#endif
|
|
#ifndef SQRT_HALF_PI
|
|
#define SQRT_HALF_PI 1.25331413732
|
|
#endif
|
|
#ifndef PHI
|
|
#define PHI 1.618033988749894848204586834
|
|
#endif
|
|
#ifndef EPSILON
|
|
#define EPSILON 0.0000001
|
|
#endif
|
|
#ifndef GOLDEN_RATIO
|
|
#define GOLDEN_RATIO 1.6180339887
|
|
#endif
|
|
#ifndef GOLDEN_RATIO_CONJUGATE
|
|
#define GOLDEN_RATIO_CONJUGATE 0.61803398875
|
|
#endif
|
|
#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians
|
|
#define GOLDEN_ANGLE 2.39996323
|
|
#endif
|
|
#ifndef DEG2RAD
|
|
#define DEG2RAD (PI / 180.0)
|
|
#endif
|
|
#ifndef RAD2DEG
|
|
#define RAD2DEG (180.0 / PI)
|
|
#endif |