sin() function in PHP


The sin() function Returns the sine of a number.

Syntax

sin(num)

Parameters

  • num − The number for which you want to Return the sine. A value in radians.

Return

The sin() function Returns the arc sine of a number.

Example

 Live Demo

<?php
   echo(sin(0.50) . "<br>");
   echo(sin(-0.90) . "<br>");
?>

Output

0.4794255386042<br>-0.78332690962748<br>

Example

Let us see another example −

 Live Demo

<?php
   echo(sin(0) . "<br>");
   echo(sin(1) . "<br>");
   echo(sin(-1) . "<br>");
   echo(sin(2) . "<br>");
?>

Output

0<br>0.8414709848079<br>-0.8414709848079<br>0.90929742682568<br>

Updated on: 27-Dec-2019

34 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements