fix: change from M_PI to PI
This commit is contained in:
@@ -3,6 +3,8 @@
|
|||||||
namespace td {
|
namespace td {
|
||||||
namespace utils{
|
namespace utils{
|
||||||
|
|
||||||
|
constexpr float PI = 3.14159274101257324219;
|
||||||
|
|
||||||
/* Sine functions */
|
/* Sine functions */
|
||||||
|
|
||||||
float easeInSine(float x);
|
float easeInSine(float x);
|
||||||
|
|||||||
@@ -8,15 +8,15 @@ namespace utils{
|
|||||||
/* Sine functions */
|
/* Sine functions */
|
||||||
|
|
||||||
float easeInSine(float x){
|
float easeInSine(float x){
|
||||||
return 1.0f - std::cos((x * M_PI) / 2.0f);
|
return 1.0f - std::cos((x * PI) / 2.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
float easeOutSine(float x){
|
float easeOutSine(float x){
|
||||||
return std::sin((x * M_PI) / 2.0f);
|
return std::sin((x * PI) / 2.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
float easeInOutSine(float x){
|
float easeInOutSine(float x){
|
||||||
return -(std::cos(M_PI * x) - 1.0f) / 2.0f;
|
return -(std::cos(PI * x) - 1.0f) / 2.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Cubic functions */
|
/* Cubic functions */
|
||||||
@@ -66,7 +66,7 @@ float easeInOutCirc(float x){
|
|||||||
/* Elastic functions */
|
/* Elastic functions */
|
||||||
|
|
||||||
float easeInElastic(float x){
|
float easeInElastic(float x){
|
||||||
const float c4 = (2 * M_PI) / 3.0f;
|
const float c4 = (2 * PI) / 3.0f;
|
||||||
|
|
||||||
return x == 0
|
return x == 0
|
||||||
? 0
|
? 0
|
||||||
@@ -76,7 +76,7 @@ float easeInElastic(float x){
|
|||||||
}
|
}
|
||||||
|
|
||||||
float easeOutElastic(float x){
|
float easeOutElastic(float x){
|
||||||
const float c4 = (2 * M_PI) / 3.0f;
|
const float c4 = (2 * PI) / 3.0f;
|
||||||
|
|
||||||
return x == 0
|
return x == 0
|
||||||
? 0
|
? 0
|
||||||
@@ -86,7 +86,7 @@ float easeOutElastic(float x){
|
|||||||
}
|
}
|
||||||
|
|
||||||
float easeInOutElastic(float x){
|
float easeInOutElastic(float x){
|
||||||
const float c5 = (2 * M_PI) / 4.5;
|
const float c5 = (2 * PI) / 4.5;
|
||||||
|
|
||||||
return x == 0
|
return x == 0
|
||||||
? 0
|
? 0
|
||||||
|
|||||||
Reference in New Issue
Block a user