PHP deg2rad() function
Complete PHP Math Reference
Definition and Usage
The deg2rad() function converts a degree to its radian number.
Syntax
Parameter |
Description |
degree_number |
Required. Specifies the degree to convert |
Example 1
<?php
echo deg2rad("30") . "<br />";
echo deg2rad("10") . "<br />";
echo deg2rad("1587") . "<br />";
echo deg2rad("70");
?>
|
The output of the code above will be:
0.523598775598
0.174532925199
27.6983752292
1.2217304764
|
Example 2
<?php
$deg = 180;
$rad = deg2rad($deg);
echo "$deg degrees is equal to $rad radians";
?>
|
The output of the code above will be:
180 degrees is equal to 3.14159265359 radians
|
Complete PHP Math Reference
The Altova MissionKit is a suite of intelligent XML tools, including:
XMLSpy® – industry-leading XML editor
- Support for all XML-based technologies
- Graphical editing views, powerful debuggers, code generation, & more
MapForce® – graphical data mapping tool
- Drag-and-drop data conversion with code generation
- Support for XML, DBs, EDI, Excel® 2007, text, Web services
StyleVision® – visual stylesheet designer
- Drag-and-drop stylesheet design for XML & databases
- Output to HTML, PDF, RTF, Word 2007, & more
And more…
Try before you buy with a free fully functional 30-day trial
Download today
|