Are there any examples for when math.deg/math.rad would be used?

Hi guys!

Although I understand what Radians and Degrees are, I was curious to know in which circumstance these would be implemented, possibly with an example, because I can’t seem to imagine why or how this would be used in ROBLOX studio, unless it were some sort of maths game or something…

All of the trig functions and CFrames are in radians because that’s how the world works. If you want to convert them to degrees to make it readable, use math.deg. If you want to convert an existing number to radians so it can be used with trig functions, use math.rad. That’s really all it is for, because though radians look pretty in equations they don’t look so good when you’re trying to figure out of the player is standing on a slope steeper than 35 degrees / 0.6109 radians.

2 Likes

Ohhh I see, so it can be used to find out about angles in a game, for example a slope, so here, you would say something like:

if saidAngle = pi/2rad (or 90deg) then
– do something
else
– do something else

You can also use it for conversions from degrees to radians because radians can be quite hard to workout if it’s some decimal.

1 Like