[Previous] [Contents] [Next]


Basic Trigonometry Functions


PHP supports the basic set of trigonometry functions and are listed in Table 2-4.

Table 2-4. Trigonometry functions supported by PHP
Function Description
float sin(float arg) Sine of arg in radians
float cos(float arg) Cosine of arg in radians
float tan(float arg) Tangent of arg in radians
float asin(float arg) Arc sine of arg in radians
float acos(float arg) Arc cosine of arg in radians
float atan(float arg) Arc tangent of arg in radians
float atan2(float y, float x) Arc tangent of x/y where the sign of both arguments determines the quadrant of the result
float pi( ) Returns the value 3.1415926535898
float deg2rad(float arg) Converts arg degrees to radians
float rad2deg(float arg) Converts arg radians to degrees

[Previous] [Contents] [Next]