PHP sin() Function

❮ PHP Math Reference

Example

Return the sine of different numbers:

<?php
echo(sin(3) . "<br>");
echo(sin(-3) . "<br>");
echo(sin(0) . "<br>");
echo(sin(M_PI) . "<br>");
echo(sin(M_PI_2));
?>
Try it Yourself »

Definition and Usage

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


Syntax

sin(number);

Parameter Values

Parameter Description
number Required. Specifies a value in radians

Technical Details

Return Value: The sine of number
Return Type: Float
PHP Version: 4+

❮ PHP Math Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.