Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

What does math.rad mean, and how would I use it? [closed]

Asked by
nanaluk01 247 Moderation Voter
7 years ago

What does math.rad mean, and how would I use it?

I have been looking at the ROBLOX Wiki, but I still do not really understand what math.rad does, or how it works.

PLEASE NOTE: I am not requesting any sort of script to be made for me, all I want to know is how it works and what it does.

This is what I want to know:

---What it can do / does

---What it can be used for

---Any other important things

Any help is greatly appreciated!

1
It converts degrees (0-360) to radians. Perci1 4988 — 7y
0
Sorry for asking, but what is a "radiant"? nanaluk01 247 — 7y
0
@nanaluk01 User#13221 15 — 7y
0
(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.) User#13221 15 — 7y

Locked by namespace25, ForeverBrown, NotFrindow, and User#5423

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
4
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
7 years ago

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)) --> 1.5705 -- (approximately pi/2)

and math.deg(rad) which converts rad measured in radians to degrees:

print(math.deg(math.pi/2)) -- approximately 90

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.

Ad