Software Engineering Wiki

Rads

Converts an angle from degrees to radians.

  • Use math.Pi and the degree to radian formula to convert the angle from degrees to radians.
import "math"

func Rads(d float64) float64 {
	return d * math.Pi / 180.0
}
Rads(90.0) // ~1.5708

Last updated 15 September 2026 · Edit this page