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