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));
?>
<?php
#Negative number in radians
echo("asin(-0.5): ");
echo (asin(-0.5));
?>

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



RELATED TAGS

php
math
sine
communitycreator

CONTRIBUTOR

harris910
RELATED COURSES

View all Courses

Keep Exploring

Learn in-demand tech skills in half the time