squiggle/packages/website/docs/Api/Math.md

85 lines
929 B
Markdown
Raw Normal View History

2022-06-05 20:59:45 +00:00
---
2022-06-11 00:35:48 +00:00
sidebar_position: 8
2022-06-05 20:59:45 +00:00
title: Math
---
### E
2022-06-11 15:57:02 +00:00
2022-06-06 05:16:29 +00:00
```
2022-06-14 01:13:43 +00:00
Math.e:
2022-06-06 05:16:29 +00:00
```
2022-06-11 15:57:02 +00:00
2022-06-11 00:35:48 +00:00
Euler's number; ≈ 2.718281828459045
2022-06-05 20:59:45 +00:00
### LN2
2022-06-11 15:57:02 +00:00
2022-06-06 05:16:29 +00:00
```
2022-06-14 01:13:43 +00:00
Math.ln2:
2022-06-06 05:16:29 +00:00
```
2022-06-11 15:57:02 +00:00
2022-06-11 00:35:48 +00:00
Natural logarithm of 2; ≈ 0.6931471805599453
2022-06-05 20:59:45 +00:00
### LN10
2022-06-11 15:57:02 +00:00
2022-06-06 05:16:29 +00:00
```
2022-06-14 01:13:43 +00:00
Math.ln10:
2022-06-06 05:16:29 +00:00
```
2022-06-11 15:57:02 +00:00
2022-06-11 00:35:48 +00:00
Natural logarithm of 10; ≈ 2.302585092994046
2022-06-05 20:59:45 +00:00
### LOG2E
2022-06-11 15:57:02 +00:00
2022-06-06 05:16:29 +00:00
```
2022-06-14 01:13:43 +00:00
Math.log2e:
2022-06-06 05:16:29 +00:00
```
2022-06-11 15:57:02 +00:00
2022-06-06 05:16:29 +00:00
Base 2 logarithm of E; ≈ 1.4426950408889634Base 2 logarithm of E; ≈ 1.4426950408889634
2022-06-05 21:13:56 +00:00
2022-06-05 20:59:45 +00:00
### LOG10E
2022-06-11 15:57:02 +00:00
2022-06-06 05:16:29 +00:00
```
2022-06-14 01:13:43 +00:00
Math.log10e:
2022-06-06 05:16:29 +00:00
```
2022-06-11 15:57:02 +00:00
2022-06-11 00:35:48 +00:00
Base 10 logarithm of E; ≈ 0.4342944819032518
2022-06-05 20:59:45 +00:00
### PI
2022-06-11 15:57:02 +00:00
2022-06-06 05:16:29 +00:00
```
2022-06-14 01:13:43 +00:00
Math.pi:
2022-06-06 05:16:29 +00:00
```
2022-06-11 15:57:02 +00:00
2022-06-11 00:35:48 +00:00
Pi - ratio of the circumference to the diameter of a circle; ≈ 3.141592653589793
2022-06-05 20:59:45 +00:00
### SQRT1_2
2022-06-11 15:57:02 +00:00
2022-06-06 05:16:29 +00:00
```
2022-06-14 01:13:43 +00:00
Math.sqrt1_2:
2022-06-06 05:16:29 +00:00
```
2022-06-11 15:57:02 +00:00
2022-06-11 00:35:48 +00:00
Square root of 1/2; ≈ 0.7071067811865476
2022-06-05 20:59:45 +00:00
### SQRT2
2022-06-11 15:57:02 +00:00
2022-06-06 05:16:29 +00:00
```
2022-06-14 01:13:43 +00:00
Math.sqrt2:
2022-06-06 05:16:29 +00:00
```
2022-06-11 15:57:02 +00:00
2022-06-11 00:35:48 +00:00
Square root of 2; ≈ 1.4142135623730951
2022-06-05 20:59:45 +00:00
### PHI
2022-06-11 15:57:02 +00:00
2022-06-06 05:16:29 +00:00
```
2022-06-14 01:13:43 +00:00
Math.phi:
2022-06-06 05:16:29 +00:00
```
2022-06-11 15:57:02 +00:00
2022-06-11 00:35:48 +00:00
Phi is the golden ratio. 1.618033988749895
2022-06-05 20:59:45 +00:00
### TAU
2022-06-11 15:57:02 +00:00
2022-06-06 05:16:29 +00:00
```
2022-06-14 01:13:43 +00:00
Math.tau:
2022-06-06 05:16:29 +00:00
```
2022-06-11 15:57:02 +00:00
Tau is the ratio constant of a circle's circumference to radius, equal to 2 \* pi. 6.283185307179586