asin(): inverse sine of a value from -1 to 1

Calculate inverse sine

asin() accepts a value from -1 through 1 and returns the corresponding angle in radians.

$angle = asin(0.5);
echo rad2deg($angle); // approximately 30

The examples below build from the basic call to practical variations and edge cases.

<?Php
echo asin(0); // Output is 0
echo "<br>";
echo asin(1); // Output  1.5707963267949
echo "<br>";
echo asin(-1); // Output is -1.5707963267949
echo "<br>";
echo asin(4); // Output is NAN 
?>
Syntax
asin(float $num): float;
The argument is a sine value, not an angle. Valid real inputs are from -1 through 1; values outside this range return NAN. The return value is an angle in radians.

Convert the returned angle to degrees

$sine = 0.5;
$angleRadians = asin($sine);
echo rad2deg($angleRadians); // 30

Example 2: Calculating arcsin for a negative value

The *asin()* function can also be used to find the inverse sine of a negative value:

$value = -0.5;
$result = asin($value);
echo "The arcsin of $value is: " . $result; 
// Outputs: The arcsin of -0.5 is: -0.5235987755983

Example 3: Converting radians to degrees after using asin()

To convert the result from radians to degrees:

$value = 0.5;
$radians = asin($value);
$degrees = rad2deg($radians);
echo "The arcsin of $value in degrees is: " . $degrees;
// Outputs: The arcsin of 0.5 in degrees is: 30

Plotting of SIN & SIN curves by using PHP GD function with deg2rad()

Questions

ACOS() function
Math Functions


Subscribe to our YouTube Channel here



plus2net.com











PHP video Tutorials
✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer