math.deg

From ComputerCraft
Jump to navigation Jump to search

math.deg
Function
Syntax
math.deg()
Returns number
API math
Source Lua (source)

Convert the number num from radians to degrees.

ExampleExamplePrint the inverse sine of user input in degrees
Read a line from the user, compute its arcsin, then convert it to degrees.
Code
print(math.deg(math.asin(tonumber(read()))))
Output Depends on what the user wrote. For instance, if they were to enter -1, the number printed would be -90.