math.sin
From ComputerCraft
Jump to navigation
Jump to search
math.sin Function | |
---|---|
Syntax math.sin(
| |
Returns | number |
API | math |
Source | Lua (source) |
Returns the sine of num.
Note: The argument must be given in radians. If it is in degrees, use the math.rad function to convert it.
|
|||
Read a line from the user, convert it to radians using math.rad, then print its sine. | |||
Code | print(math.sin(math.rad(tonumber(read())))
|
||
Output | Depends on what the user wrote. For instance, if they were to enter 90 , the number printed would be 1 . |
Retrieved from "https://wiki.computercraft.cc/index.php?title=Math.sin&oldid=3429"