
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Cos Function in PHP
The cos() function Returns the cosine of a number. A numeric value between -1 and 1 is Returned representing the cosine of the angle.
Syntax
cos(num)
Parameters
num − The specified value in radians
Return
The cos() function Returns cosine of a number in float. A numeric value between -1 and 1 is Returned representing the cosine of the angle.
Example
<?php echo(cos(1) . "<br>"); echo(cos(-1)); ?>
Output
0.54030230586814<br>0.54030230586814
Example
Let us see another example −
<?php echo(cos(0)); ?>
Output
1
Advertisements