|
| 1 | +<!-- GENERATED FILE, DO NOT MODIFY--> |
| 2 | + |
| 3 | +[Back to README](../README.md) |
| 4 | + |
| 5 | +# Standard Library Cheatsheet |
| 6 | + |
| 7 | +Last updated: Mon, 30 Dec 2019 15:32:37 GMT |
| 8 | + |
| 9 | + |
| 10 | +## Usage |
| 11 | + |
| 12 | +``` |
| 13 | +吾嘗觀「「算經」」之書。方悟「正弦」「餘弦」「圓周率」之義。 |
| 14 | +``` |
| 15 | + |
| 16 | +## [易經](../lib/易經.wy) |
| 17 | + |
| 18 | +| Wenyan | Javascript Equivalent | |
| 19 | +|---|---| |
| 20 | + |
| 21 | +## [算經](../lib/算經.wy) |
| 22 | + |
| 23 | +| Wenyan | Javascript Equivalent | |
| 24 | +|---|---| |
| 25 | +| [`圓周率`](../lib/算經.wy#L166) | `Math.PI` | |
| 26 | +| [`倍圓周率`](../lib/算經.wy#L169) | `Math.PI * 2` | |
| 27 | +| [`半圓周率`](../lib/算經.wy#L172) | `Math.PI / 2` | |
| 28 | +| [`四分圓周率`](../lib/算經.wy#L175) | `Math.PI / 4` | |
| 29 | +| [`自然常數`](../lib/算經.wy#L177) | `Math.E` | |
| 30 | +| [`歐拉常數`](../lib/算經.wy#L179) | `0.5772156649015329` | |
| 31 | +| [`黃金分割數`](../lib/算經.wy#L181) | `1.618033988749895` | |
| 32 | +| [`二之平方根`](../lib/算經.wy#L183) | `Math.SQRT2` | |
| 33 | +| [`二之對數`](../lib/算經.wy#L185) | `Math.LN2` | |
| 34 | +| [`十之對數`](../lib/算經.wy#L187) | `Math.LN10` | |
| 35 | +| [`不可算數乎`](../lib/算經.wy#L190) | `Number.isNaN` | |
| 36 | +| [`浮點移位`](../lib/算經.wy#L392) | `x * Math.pow(2, y), y is integer` | |
| 37 | +| [`析浮點數`](../lib/算經.wy#L428) | `N/A` | |
| 38 | +| [`正弦`](../lib/算經.wy#L472) | `Math.sin` | |
| 39 | +| [`餘弦`](../lib/算經.wy#L502) | `Math.cos` | |
| 40 | +| [`反正弦`](../lib/算經.wy#L510) | `Math.asin` | |
| 41 | +| [`反餘弦`](../lib/算經.wy#L537) | `Math.acos` | |
| 42 | +| [`正切`](../lib/算經.wy#L544) | `Math.tan` | |
| 43 | +| [`反正切`](../lib/算經.wy#L581) | `Math.atan` | |
| 44 | +| [`勾股求角`](../lib/算經.wy#L615) | `Math.atan2` | |
| 45 | +| [`勾股求弦`](../lib/算經.wy#L633) | `Math.hypot` | |
| 46 | +| [`對數`](../lib/算經.wy#L670) | `Math.log` | |
| 47 | +| [`指數`](../lib/算經.wy#L713) | `Math.exp` | |
| 48 | +| [`冪`](../lib/算經.wy#L749) | `Math.pow` | |
| 49 | +| [`平方根`](../lib/算經.wy#L773) | `Math.sqrt` | |
| 50 | +| [`絕對`](../lib/算經.wy#L834) | `Math.abs` | |
| 51 | +| [`取頂`](../lib/算經.wy#L839) | `Math.ceil` | |
| 52 | +| [`取底`](../lib/算經.wy#L844) | `Math.floor` | |
| 53 | +| [`取整`](../lib/算經.wy#L859) | `Math.round, but rounded away from zero when the fractional part is exactly 0.5` | |
| 54 | +| [`捨餘`](../lib/算經.wy#L873) | `Math.trunc` | |
| 55 | +| [`正負`](../lib/算經.wy#L883) | `Math.sign` | |
| 56 | + |
| 57 | +## [籌經](../lib/籌經.wy) |
| 58 | + |
| 59 | +| Wenyan | Javascript Equivalent | |
| 60 | +|---|---| |
| 61 | +| [`求和`](../lib/籌經.wy#L1) | `reduce((a,b)=>a+b)` | |
| 62 | + |
| 63 | +## [位經](../lib/js/位經.wy) |
| 64 | + |
| 65 | +| Wenyan | Javascript Equivalent | |
| 66 | +|---|---| |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | +## Help update this cheatsheet |
| 72 | + |
| 73 | +This cheatsheet is generated direct from stdlibs. There are still a lot of functions are not listed above. If you would like to hep update this cheatsheet, here is the steps. |
| 74 | + |
| 75 | +Add comments in the stdlib files (one line above the function/value), the format should look like this: |
| 76 | +``` |
| 77 | +注曰「「餘弦。同Javascript之Math.cos也。」」 |
| 78 | +``` |
| 79 | + |
| 80 | +After you fill the comments, you need to update the document by running |
| 81 | +```bash |
| 82 | +npm run docs:update |
| 83 | +``` |
| 84 | + |
| 85 | +Check the output document out and submit a pull request. Thank you! |
0 commit comments