I get if this is a more complicated thing to ask, or if its a stupid question, but I want to ask it either way.
For the case of CFrame
, If you use math.pi/2
for its Orientation, it would apply a 90 degree rotation. If you remove the /2
and simply say math.pi
, it will rotate 180 degrees, However this is just CFrame
, using it with Vector3
like maybe BasePart.Orientation
wouldn’t exactly work, and would only increment a few Degrees instead of making a complete Right Angle, like with CFrame
, However, that may just be that I’m using it wrong for Vector3
The Usage of math.pi/2
Im referring to:
Instance.CFrame = Instance.CFrame * CFrame.Angles(0, math.pi/2, 0) -- makes a 90 degree rotation to the object
printing math.pi/2
would give you something along the lines of 1.57,and if you convert a number to radians, which in this case we would do math.rad(90)
, it would return this exact number. While if you change 90 to 180, it will return the “exact” number of pi
.
print(math.rad(90), math.pi/2)
print(math.rad(180), math.pi)
-- same number
Why does this work?
Its sort of something I dont exactly understand, and I was hoping someone could help clear things up.