Describes common objective-c Functions and constant variables.
Arithmetic functions
Arithmetic functions]
Function Name |
Description |
Int rand () |
Random Number Generation. (Example) Srand (Time (NiL); // initial Random Number Int val = rand () P; // 0 ~ Random Number between 49 |
Int ABS (int) |
Absolute value of an integer (Example) int val = ABS (-8 ); → 8 ※Fabs is used for Floating Point. |
Double FABS (double) |
Absolute Value of a floating point (Example) Double val = FABS (-12.345 ); → 12.345 ※Abs is used for integers. |
Double floor (double) |
Returns the integer part of the floating point number (discard the decimal point) (Example) Double val = floor (12.345 ); → 12.000 |
Double Ceil (double ); |
Return the integer part of the floating point number (discard the decimal part and enter 1 in the single digit) (Example) Double val = Ceil (12.345 ); → 13.000 |
Double POW (double A, double B) |
B power of (Example) Double val = POW (2, 3 ); → 8 |
Double SQRT (double) |
Square root of (Example) Double val = SQRT (2 ); → 1.41421356 |
Trigonometric function
Trigonometric function]
Function Name |
Description |
Double cos (double) |
Cosine Function (A: radian) |
Double sin (double) |
Sine function (A: radian) |
Double Tan (double) |
Tangent function (A: radian) |
Double asin (double) |
Arcsin (A: radian) |
Double ACOs (double) |
Arccosine function (A: radian) |
Double atan (double) |
Arctangent Function |
Double atan2 (double A, double B) |
Returns the arc tangent of the given coordinate values A and B. |
Exponential functions
[Exponential function]
Function Name |
Description |
Double Log (double) |
Base on E |
Double log10 (double) |
Log of the logarithm function |
Constant
Constant
Constant name |
Description |
M_pi |
Circumference rate (= π) |
M_pi_2 |
1/2 of the circumference rate (= π/2) |
M_pi_4 |
1/4 of the circumference rate (= π/4) |
M_1_pi |
= 1/π |
M_2_pi |
= 2/π |
M_e |
= E |
M_log2e |
Log_2 (E) |
M_log10e |
Log_10 (E) |
Objective-C common functions and variables