• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

PHP asin function – Arc sine

by admin

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/>";
?>

Filed Under: PHP

Some more articles you might also be interested in …

  1. PHP function str_replace() – Replace all occurrences of the search string with the replacement string
  2. PHP ceil function – Round fractions up
  3. PHP function abs – Absolute value
  4. PHP function str_repeat() – Repeat a string
  5. PHP atanh function – Inverse hyperbolic tangent
  6. PHP Function strchr() – Alias of strstr()
  7. PHP function stripslashes() – Un-quotes a quoted string
  8. PHP function chr() – Generate a single-byte string from a number
  9. PHP addslashes function – Quote string with slashes
  10. PHP function str_ireplace() – Case-insensitive version of str_replace()

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright