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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

PHP function acos – Arc cosine

by admin

Description

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

$acos1 = acos(0.4346);
$acos2 = acos(cos(80));

Syntax:

acos(float $num): float

Parameters

Parameter Description
num The argument to process

Return Values

The arc cosine of num in radians.

Example

Calculate the arccosine of a value

$cos = 0.5; 
echo "The arccosine of $cos is ", acos($cos); 

Filed Under: PHP

Some more articles you might also be interested in …

  1. PHP bindec function – Convert a number between arbitrary bases
  2. PHP function strlen() – Get string length
  3. PHP asin function – Arc sine
  4. PHP connection_status function – Returns connection status bitfield
  5. PHP function str_ireplace() – Case-insensitive version of str_replace()
  6. PHP Function str_split() – Convert a string to an array
  7. PHP function str_repeat() – Repeat a string
  8. PHP function convert_cyr_string() – Convert from one Cyrillic character set to another
  9. PHP base_convert function – Convert a number between arbitrary bases
  10. PHP atan function – Arc tangent

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright