PHP sin( ) function
sin() is a trigonometric ratio in mathematical concept called Trigonometry. Programmers sometimes need to use trigonometric function sine in developing the scientific modules development through php programming. Hence, PHP programming developing team introduced sine function in PHP4 to calculate sine values for different angles through PHP programming language. It perfectly works in current programming level PHP5. It is designed and developed to return sine values for radians scale.
According to Trigonometry,
Ratio between opposite side and hypotenuse is called Sine. It is mathematically expressed by considering Theta (θ) as angle of the right angle triangle.
|sin θ||=||Opposite Side
In PHP, syntax of this mathematical function sine is defined as given below code box to understand functionality of sine function fundamentally.
This fundamental syntax can be written as given below to use it quickly. It also helps php programmers to remember sine function easily.
In this syntax, θ is an angle of the triangle.
How to use
Sine function accepts any value as angle from Real Numbers group and returns associated sine value. In PHP, specifying the angle inside the brackets makes sine function to return its associated value as output in web browser.
<?php echo sin(15); ?>
In this example, sine function returned a value for an angle and it is a positive value. Similarly, sine function also gives negative values for some angles.
<?php echo sin(100); ?>
Trigonometric function sine’s domain is R but it returns values from -1 to 1. This interval is known range of the sine function.