PHP asin function – Arc sine

Description

The asin() function calculates the arc sine value of the number provided as its only parameter, essentially reversing the operation of sine(). The return value is in radians—you should use the rad2deg() to convert radians to degrees.

$asin1 = asin(0.4346);
$asin2 = asin(sin(80));

Syntax:

asin(float $num): float

Parameters

Parameter Description
num The argument to process.

Return Values

The arc sine of num in radians.

Examples

Example 1:

$sin = 0.75; 
echo "The arcsine of $sin is ", asin($sin); 

Example 2:

<?php
    $arg = 0.5;
    $val = asin($arg);
    echo "asin(" . $arg . ") = " . $val . " radians.<br/>";
    echo "Pi value = " . pi() . "<br/>";  
    echo "asin(" . $arg . ") = " . $val/pi()*180 . " degrees<br/>";
?>

Example 3:

<?php
    $arg = 1;
    $val = asin($arg);
    echo "asin(" . $arg . ") = " . $val . " radians.<br/>";
    echo "Pi value = " . pi() . "<br/>";  
    echo "asin(" . $arg . ") = " . $val/pi()*180 . " degrees<br/>";
?>
Related Post