Why is the part of this script doing the math.tan - work, not functioning properly?
It returns that "a" is equal to a negative number, when it is supposed to be 0.577, why?
How can I fix this?
My coding is as follows:
function CalculateArea(s,n) --// s = side-length, n = number of sides
local p = s*n
local a = math.tan(180/n) --//Supposed to return 30 when n == 6, but it doesn't :-/
print(a)
end
CalculateArea(10,6)
Any help is greatly appreciated!

1 comment
But the tangent of 180/6 is 0.57735026919