math.rad
math.rad Function | |
---|---|
Syntax math.rad(
| |
Returns | number |
API | math |
Source | Lua (source) |
Convert the number num from degrees to radians.
|
|||
Read a line from the user, convert it to radians, then print its math.sin. | |||
Code | <nowiki>
print(math.sin(math.rad(tonumber(read())))
</nowiki>
|
||
Output | Depends on what the user wrote. For instance, if they were to enter -1 , the number printed would be -90 . |
Functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Lua |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CC:Tweaked |
|
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.