DegToRad v0.1.0
Converts an angle from degrees to radians.
Package: Math
Signature
func DegToRad(x: float64) -> float64;
func DegToRad(x: float32) -> float32;
Parameters
| Name | Type | Description |
|---|---|---|
x | float64 / float32 | An angle, in degrees. |
Returns
x scaled by Pi/180. The conversion is faithful enough that round numbers
come out exact: DegToRad(180.0) is Pi. Infinities, NaN, and the sign of a
zero all fall out of the multiplication unchanged.
Example
import Math::DegToRad;
func Main() -> int {
let radians = DegToRad(180.0); // 3.141592653589793 (Pi)
let quarter = DegToRad(90.0); // 1.5707963267948966 (HalfPi)
return 0;
}