-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
227 additions
and
31 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,196 @@ | ||
# Math | ||
|
||
## `Math.random` | ||
|
||
Returns a random value within `0` and `1`. | ||
|
||
```title="Signature" | ||
-> : Number | ||
``` | ||
|
||
```title="Example" | ||
value := Math.random(); | ||
# prints 0.3245124 | ||
print(value); | ||
``` | ||
|
||
## `Math.pi` | ||
|
||
Returns the value of PI. | ||
|
||
```title="Signature" | ||
-> : Number | ||
``` | ||
|
||
```title="Example" | ||
pi := Math.pi(); | ||
# prints 3.1415926535897932 | ||
print(pi); | ||
``` | ||
|
||
## `Math.sin` | ||
|
||
Returns sine of the value. | ||
|
||
```title="Signature" | ||
-> Number value : Number | ||
``` | ||
|
||
```title="Example" | ||
value := Math.sin(1); | ||
# prints 0.8414709848078965 | ||
print(value); | ||
``` | ||
|
||
## `Math.cos` | ||
|
||
Returns cosine of the value. | ||
|
||
```title="Signature" | ||
-> Number value : Number | ||
``` | ||
|
||
```title="Example" | ||
value := Math.cos(1); | ||
# prints 0.5403023058681398 | ||
print(value); | ||
``` | ||
|
||
## `Math.tan` | ||
|
||
Returns tangent of the value. | ||
|
||
```title="Signature" | ||
-> Number value : Number | ||
``` | ||
|
||
```title="Example" | ||
value := Math.tan(1); | ||
# prints 1.5574077246549023 | ||
print(value); | ||
``` | ||
|
||
## `Math.asin` | ||
|
||
Returns arc sine of the value. | ||
|
||
```title="Signature" | ||
-> Number value : Number | ||
``` | ||
|
||
```title="Example" | ||
value := Math.asin(1); | ||
# prints 1.5707963267948966 | ||
print(value); | ||
``` | ||
|
||
## `Math.acos` | ||
|
||
Returns arc cosine of the value. | ||
|
||
```title="Signature" | ||
-> Number value : Number | ||
``` | ||
|
||
```title="Example" | ||
value := Math.acos(1); | ||
# prints 0 | ||
print(value); | ||
``` | ||
|
||
## `Math.atan` | ||
|
||
Returns arc tangent of the value. | ||
|
||
```title="Signature" | ||
-> Number value : Number | ||
``` | ||
|
||
```title="Example" | ||
value := Math.atan(1); | ||
# prints 0.7853981633974483 | ||
print(value); | ||
``` | ||
|
||
## `Math.atan2` | ||
|
||
A variant of `Math.atan`. | ||
|
||
```title="Signature" | ||
-> Number a, Number b : Number | ||
``` | ||
|
||
```title="Example" | ||
value := Math.atan2(1, 2); | ||
# prints 0.4636476090008061 | ||
print(value); | ||
``` | ||
|
||
## `Math.exp` | ||
|
||
Returns natural exponent of the value. | ||
|
||
```title="Signature" | ||
-> Number value : Number | ||
``` | ||
|
||
```title="Example" | ||
value := Math.exp(1); | ||
# prints 2.718281828459045 | ||
print(value); | ||
``` | ||
|
||
## `Math.log` | ||
|
||
Returns natural logarithm of the value. | ||
|
||
```title="Signature" | ||
-> Number value : Number | ||
``` | ||
|
||
```title="Example" | ||
value := Math.log(2); | ||
# prints 0.6931471805599453 | ||
print(value); | ||
``` | ||
|
||
## `Math.min` | ||
|
||
Returns minimum value in `a` and `b`. | ||
|
||
```title="Signature" | ||
-> Number a, Number b : Number | ||
``` | ||
|
||
```title="Example" | ||
value := Math.min(-1, 1); | ||
# prints -1 | ||
print(value); | ||
``` | ||
|
||
## `Math.max` | ||
|
||
Returns maximum value in `a` and `b`. | ||
|
||
```title="Signature" | ||
-> Number a, Number b : Number | ||
``` | ||
|
||
```title="Example" | ||
value := Math.max(-1, 1); | ||
# prints 1 | ||
print(value); | ||
``` |
This file contains 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
This file contains 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
This file contains 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
This file contains 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