Angle calculations are common in game development. Use these formulas to convert between degrees and radians.
Degrees to radians
1 | function math.angle2radian(angle) |
Radians to degrees
1 | function math.radian2angle(radian) |
For example, math.angle2radian(180) returns π, while math.radian2angle(math.pi / 2) returns 90.