Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make the math.pi/ method equal to the Rotation I have provided (Making it the same)?

How do I use the math.pi/10 to make it equal to the rotation I provided. So far, I figured out that math.pi/10 is equal to 90, -69.598, 90. Also, thank you to all who said to use the fromEulerAnglesXYZ method.

tune.CFrame = tune.CFrame * CFrame.fromEulerAnglesXYZ(math.pi/10,0,0)
-- 1. -69.598 (Rotation: 90, -69.598, 90) 
-- 2. -51.347 (Rotation: 90, -51.347, 90)
-- 3. -32.948 (Rotation: 90, -32.948, 90)
-- 4. -17.872 (Rotation: 90, -17.872, 90)
-- 5. -0.45 (Rotation: 90, -0.45, 90)
-- 6. 16.889 (Rotation: 90, 16.889, 90)
-- 7. 33.83 (Rotation: 90, 33.83, 90)
-- 8. 47.591 (Rotation: 90, 47.591, 90)
-- 9. 61.501 (Rotation: 90, 61.501, 90)
-- 10. 77.796 (Rotation: 90, 77.796, 90)

2 comments

0

pi = 180 degrees

0

So what does math.pi/10 mean? Is it 180/10 which is 18?

1 answer

✓ Accepted answer

CFrame.Angles (a much shorter name for CFrame.fromEulerAnglesXYZ) uses radians, like most of mathematics.

One full circle is 360 degrees, or 2*pi radians. Thus 1 degree is just 2*pi / 360 radians.


You can easily convert yourself:

16 degrees is 16 * (2 * pi / 360) radians = .27925 radians.


Don't convert yourself, though. math.rad(deg) changes deg, an amount in degrees, to radians.

math.deg(rad) changes rad, an amount in radians, to degrees.

Thus 45 degrees is math.rad(45) radians.

pi radians is math.deg(math.pi) degrees.

This discussion is preserved as it was. New answers, comments, and votes are closed.