radians() : Convert Degrees to Radians
On this page
Summary
Convert an angle from degrees to radians.
Signature
radians(degrees)
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
degrees |
Number | Yes | The angle in degrees |
Returns
Type: Double
The angle in radians.
Examples
Convert Common Angles
Output:
<p>30° = 0.524 radians</p>
<p>45° = 0.785 radians</p>
<p>90° = 1.571 radians</p>
<p>180° = 3.142 radians</p>
Use with Trigonometric Functions
Output:
<p>sin(30°) = 0.500</p>
<p>cos(60°) = 0.500</p>
<p>tan(45°) = 1.000</p>
Calculate Circular Position
Data:
doc.Params["model"] = new {
radius = 10,
angle = 45 // degrees
};
Output:
<p>X: 7.07</p>
<p>Y: 7.07</p>
Notes
- Converts degrees to radians
- Formula: radians = degrees × (π/180)
- Inverse of
degrees()function - Required for trigonometric functions (sin, cos, tan)
- 360° = 2π radians, 180° = π radians