PHP asin() Function

Definition

The asin() function calculates the arc sine value, It reverses the operation of sine().

Syntax

PHP asin() Function has the following syntax.

float asin ( float num )

Parameter

Parameter Is Required Description
num Required. Specifies a number in range -1 to 1

Return

The return value is in radians. We can use the rad2deg() to convert radians to degrees.

asin(1) returns the value of Pi/2.

Example

Calculate the arc sine value

 
<?php/*  w  w w.  ja  v a 2s  . c  om*/
$asin1 = asin(0.46); 
print($asin1);
$asin2 = asin(sin(8));
print($asin2);

echo(asin(0.4) . "\n");
echo(asin(-0.4) . "\n");
echo(asin(0) . "\n");
echo(asin(-1) . "\n");
echo(asin(1) . "\n");
echo(asin(2));
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions