✓ Accepted answer
You're probably familiar with the unit of degrees to measure angles. 90 degrees makes a right-angle, 180 degrees is half way around a circle, a full way around a circle is 360 degrees.
While everyday life and engineering typically uses degrees, mathematics and physics typically use a different unit of angle called radians.
There are 360 degrees in a circle.
There are 2*pi radians in a circle. Why? If you have a circle of radius 1 and angle T in radians, the length of the circumference along that angle is T -- which is both convenient, and also beautiful in many identities (e.g., in calculus, d/dx sin(x) = cos(x) if sin and cos take radians)
Because humans typically prefer to use degrees, Lua provides the functions math.rad(deg) which converts deg measured in degrees to radians:
print(math.rad(90))
and math.deg(rad) which converts rad measured in radians to degrees:
print(math.deg(math.pi/2))
Most functions in Lua use radians rather than degrees. These include
CFrame.Angles
math.cos / math.sin / math.tan
math.atan2, math.acos, math.atan, math.asin
I personally rarely use math.rad and math.deg, because after using radians for so long I usually think of angles in terms of them. As a result I tend to write things like math.pi/6 rather than math.rad(30) -- but the second is definitely more useful for many cases and many people.
4 comments
It converts degrees (0-360) to radians.
Sorry for asking, but what is a "radiant"?
@nanaluk01
(I accidentally pressed enter) The "t" in front of a radian means nothing. Radiant = radian which is the degrees of a circle. (radiant can also mean radiating brightly.)