PHP deg2rad() Function
Example
Convert degrees to radians:
"; echo deg2rad("90") . ""; echo deg2rad("360"); ?>
Run Example »
Definition and Usage
The deg2rad() function converts a degree value to a radian value.
**Tip:** To convert radians to degrees, see rad2deg() function in Vue 3.
Syntax
deg2rad(
number
);
| Parameters | Description |
|---|---|
| number | Required. Specifies the degree to convert. |
Technical Details
| Return Value: | number The corresponding radian value. |
|---|---|
| Return Type: | Float |
| PHP Version: | 4+ |
More examples
Example 1
Convert degrees to their corresponding radians:
Run Example »
PHP Math Reference Manual