PHP asin() Function

In this chapter you will learn:

  1. Definition for PHP asin() Function
  2. Syntax for PHP asin() Function
  3. Parameter for PHP asin() Function
  4. Return for PHP asin() Function
  5. Example - calculate the arc sine value

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/*  ja va2s .  c  o  m*/
$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.

Next chapter...

What you will learn in the next chapter:

  1. Definition for PHP asinh() Function
  2. Syntax for PHP asinh() Function
  3. Parameter for PHP asinh() Function
  4. Return for PHP asinh() Function
  5. Example - Return the inverse hyperbolic sine of different numbers