Software Engineering Wiki

Degrees

Converts an angle from radians to degrees.

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

func Degrees(r float64) float64 {
	return r * 180.0 / math.Pi
}
Degrees(math.Pi / 2.0) // 90.0

Last updated 15 September 2026 · Edit this page