Last active
April 20, 2018 12:33
-
-
Save ElectricImpSampleCode/a0120760d7c40bd2cb59 to your computer and use it in GitHub Desktop.
Squirrel math cos() example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local hypotenuse = 5; | |
| local angleInDegrees = 30; | |
| local angleInRadians = (angleInDegrees * PI) / 180; | |
| local cos = math.cos(angleInRadians); | |
| local adjacentSide = cos * hypotenuse; | |
| // 'adjacentSide' equals 4.33013 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment