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