math.asin

From ComputerCraft
Jump to navigation Jump to search

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

Returns the arcsine of num.

ExampleExamplePrint the arcsine of user input
Read a line from the user, compute its sine, and print the result in radians and degrees.
Code
local num = math.asin(tonumber(read()))
print(num)
print(math.deg(num))
Output Depends on what the user wrote. For instance, if they were to enter 0.5, the numbers printed would be 0.523598776 (Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \frac{\pi}{6}} ) and 30.