Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

php
math
sine
communitycreator

What is asin() in PHP?

harris910

The asin()arc sine function returns the inverse sine of a number. To be more specific, it returns the inverse sine of a number in radians.

Figure 1 shows the mathematical representation of the asin() function.

Figure 1: Mathematical representation of inverse sine function

To convert radians to degrees, use:

degrees = radians * ( 180.0 / M_PI )

Syntax

float asin(num)

Parameter

The asin() function requires a number as a parameter.

Return value

asin() returns the inverse sine of the number that is sent as a parameter. The return value lies in the interval [-pi/2, pi/2] in radians.

Example

<?php
#Positive number in radians
echo("asin(0.5): ");
echo (asin(0.5));
echo(" Radians")
?>	
<?php
#Negative number in radians
echo("asin(-0.5): ");
echo (asin(-0.5));
echo(" Radians")
?>

<?php
#applying asin() and then converting the result in radians to degrees
#radians = 0.5
echo("asin(0.5) * (180.0 / M_PI)): ");
echo (asin(0.5) * (180.0 / M_PI));
echo(" Degrees")
?>

RELATED TAGS

php
math
sine
communitycreator
RELATED COURSES

View all Courses

Keep Exploring