Math - SWTube/Darkest-Cave GitHub Wiki
์ํ๊ณผ ๊ด๋ จ๋ ์ฌ๋ฌ ํจ์ ๋ฐ ์์๋ฅผ ์ ์ํ ํด๋์ค์ด๋ค.
Name | Description |
---|---|
float EPSILON = 0.000001; |
๋งค์ฐ ์์ ์ค์๋ฅผ ๋ํ๋ธ๋ค. |
float PI = 3.141592; |
์์ฃผ์จ ฯ์ ์์์ 6์๋ฆฌ ๊ทผ์ฌ์น์ด๋ค. |
float TWO_PI = 2.f * PI; |
2ฯ |
float HALF_PI = PI / 2.f; |
1/2 x ฯ |
float INV_PI = 1.f / PI; |
1 / ฯ |
float INV_TWO_PI = 1.f / TWO_PI; |
1 / 2ฯ |
float DEG_TO_RAD = 0.0174533; |
๊ฐ๋๋ฅผ Degree์์ Radian์ผ๋ก ๋ณํํ ๋ ์ฌ์ฉํ๋ค. (ex. 30 degree == 0.523599 radian) |
float RAD_TO_DEG = 57.2958; |
๊ฐ๋๋ฅผ Radian์์ Degree๋ก ๋ณํํ ๋ ์ฌ์ฉํ๋ค. (ex. 1.04719755119401 radian == 60 degree) |
ใ ?ใน (๋ฏผํ ์ฃผ์ ์ํ)
Name | Description |
---|---|
GetBitCount8 |
|
GetBitCount16 |
|
GetBitCount32 |
|
GetBitCount64 |
|
GetFibonacciNumber |
|
GetFibonacciNumberRecursive |
|
GetMaxSizeType |
|
GetMinSizeType |
ํฉํ ๋ฆฌ์ผ
Name | Description |
---|---|
RecursiveFactorial |
ํ๋ผ๋ฏธํฐ๋ก ๋ค์ด์จ ์์ Factorial ๊ฐ์ ๋ฐํํ๋ค. (public member function) |
์ผ๊ฐํจ์
Name | Description |
---|---|
float Sin(float angle) |
angle ํ๋ผ๋ฏธํฐ์ ๋ฐ๋ฅธ Sin ๊ฐ์ ๋ฐํํ๋ค. (public member function) |
float Cos(float angle) |
angle ํ๋ผ๋ฏธํฐ์ ๋ฐ๋ฅธ Cos ๊ฐ์ ๋ฐํํ๋ค. (public member function) |
float Tan(float angle) |
angle ํ๋ผ๋ฏธํฐ์ ๋ฐ๋ฅธ Tan ๊ฐ์ ๋ฐํํ๋ค. (public member function) |
float ArcSin(float angle) |
angle ํ๋ผ๋ฏธํฐ์ ๋ฐ๋ฅธ ArcSin ๊ฐ์ ๋ฐํํ๋ค. (Sin์ ์ญํจ์) (public member function) |
float ArcCos(float angle) |
angle ํ๋ผ๋ฏธํฐ์ ๋ฐ๋ฅธ ArcCos ๊ฐ์ ๋ฐํํ๋ค. (Cos์ ์ญํจ์) (public member function) |
float ArcTan(float angle) |
angle ํ๋ผ๋ฏธํฐ์ ๋ฐ๋ฅธ ArcTan ๊ฐ์ ๋ฐํํ๋ค. (Tan์ ์ญํจ์) (public member function) |
์ฒ์ฅ & ๋ฐ๋ฅํจ์ (Wikipedia)
Name | Description |
---|---|
int32_t Ceil(float value) |
value๋ณด๋ค ํฐ ์ ์ ์ค ๊ฐ์ฅ ์์ ๊ฐ์ ๋ฐํํ๋ค. (public member function) |
int32_t Floor(float value) |
value๋ณด๋ค ์์ ์ ์ ์ค ๊ฐ์ฅ ํฐ ๊ฐ์ ๋ฐํํ๋ค. (public member function) |
์ง์ & ์ ๋๊ฐ
Name | Description |
---|---|
float Exp(float value) |
value์ ๋ฐ๋ฅธ e^x ๊ฐ์ ๋ฐํํ๋ค. (public member function) |
int32_t Abs(int32_t value) |
์ ์ value์ ์ ๋๊ฐ์ ๋ฐํํ๋ค. (public member function) |
float FAbs(float value) |
์ค์ value์ ์ ๋๊ฐ์ ๋ฐํํ๋ค. (public member function) |
๋ชจ๋๋ก ์ฐ์ฐ
Name | Description |
---|---|
float Mod(float numerator, float denominator) |
numerator๋ฅผ denominator๋ก ๋๋ ๋๋จธ์ง๋ฅผ ๋ฐํํ๋ค. (public member function) |
๊ฑฐ๋ญ์ ๊ณฑ
Name | Description |
---|---|
float Pow(float base, int32_t exponent) |
(base)^(exponent)๋ฅผ ๋ฐํํ๋ค. exponent์ ๊ฒฝ์ฐ ์ ์๋ง ์ฌ ์ ์๋ค. (public member function) |
์ ๊ณฑ๊ทผ (Square Root & Inverse Square Root)
Name | Description |
---|---|
float Sqrt(float value) |
sqrt(value)๋ฅผ ๋ฐํํ๋ค. (public member function) |
float InverseSqrt(float value) |
1 / sqrt(value)๋ฅผ ๋ฐํํ๋ค. (public member function) |
๋ก๊ทธํจ์
Name | Description |
---|---|
float Log(float value) |
log(value)๋ฅผ ๋ฐํํ๋ค. (public member function) |
๋ณด๊ฐ๋ฒ (Interpolation)
Name | Description |
---|---|
float Lerp(const float one, const float other, float alpha) |
one๊ณผ other ์ฌ์ด์ ๊ฐ์ alpha์ ๋น์จ๋ก ๊ณ์ฐํ์ฌ ๋ฐํํ๋ค. (0 <= alpha < 1) (public member function) |
float NearestNeighbor(const float f0, const float f1, float t) |
f0๊ณผ f1 ์ค ๋ ๊ฐ๊น์ด ๊ฐ์ ๋ฐํํ๋ค. (ex. NearestNeighbor(2.2, 3.9, 0.3) == 2.2 (public member function) |
float CatmullRomSpline(const float f0, const float f1, const float f2, const float f3, float f) |
๊ฐ f0, f1, f2, f3์ ๋ํด ๋งค๊ฐ๋ณ์ f๋ฅผ ๊ฐ๋ ์คํ๋ผ์ธ ๊ณก์ ์ ์ป์. (public member function) |