4
4
5
5
# Standard Library Cheatsheet
6
6
7
- Last updated: Mon, 30 Dec 2019 15:32:37 GMT
7
+ Last updated: Sat, 04 Jan 2020 12:49:12 GMT
8
8
9
9
10
10
## Usage
@@ -13,11 +13,61 @@ Last updated: Mon, 30 Dec 2019 15:32:37 GMT
13
13
吾嘗觀「「算經」」之書。方悟「正弦」「餘弦」「圓周率」之義。
14
14
```
15
15
16
+ ## [ 列經] ( ../lib/列經.wy )
17
+
18
+ | Wenyan | Javascript Equivalent |
19
+ | ---| ---|
20
+
16
21
## [ 易經] ( ../lib/易經.wy )
17
22
18
23
| Wenyan | Javascript Equivalent |
19
24
| ---| ---|
20
25
26
+ ## [ 曆法] ( ../lib/曆法.wy )
27
+
28
+ | Wenyan | Javascript Equivalent |
29
+ | ---| ---|
30
+ | [ ` 今何紀元時 ` ] ( ../lib/曆法.wy#L9 ) | ` Date.now() / 1000 ` |
31
+ | [ ` 言今之日時 ` ] ( ../lib/曆法.wy#L14 ) | ` new Date().toString(), in Chinese calendar ` |
32
+ | [ ` 言今之年月日 ` ] ( ../lib/曆法.wy#L19 ) | ` new Date().toDateString(), in Chinese calendar ` |
33
+ | [ ` 言今之時刻 ` ] ( ../lib/曆法.wy#L24 ) | ` new Date().toTimeString(), in Chinese calendar ` |
34
+ | [ ` 今年何年號 ` ] ( ../lib/曆法.wy#L29 ) | ` "西元" for modern dates ` |
35
+ | [ ` 今年何年 ` ] ( ../lib/曆法.wy#L34 ) | ` new Date().getFullYear() for modern dates, in Chinese calendar ` |
36
+ | [ ` 今年何干支 ` ] ( ../lib/曆法.wy#L40 ) | ` Get index (1 to 60) of this year in the 60-year cycle ` |
37
+ | [ ` 今年積何年 ` ] ( ../lib/曆法.wy#L46 ) | ` new Date().getFullYear() + 2697, in Chinese calendar ` |
38
+ | [ ` 今月何月 ` ] ( ../lib/曆法.wy#L53 ) | ` new Date().getMonth() + 1, N + 0.5 for leap months, in Chinese calendar ` |
39
+ | [ ` 今月積何月 ` ] ( ../lib/曆法.wy#L60 ) | ` Get continuously counting month number of this month ` |
40
+ | [ ` 今日何日 ` ] ( ../lib/曆法.wy#L67 ) | ` new Date().getDate(), in Chinese calendar ` |
41
+ | [ ` 今日何干支 ` ] ( ../lib/曆法.wy#L74 ) | ` Get index (1 to 60) of today in the 60-day cycle ` |
42
+ | [ ` 今日積何日 ` ] ( ../lib/曆法.wy#L80 ) | ` Get continuously counting day number of today ` |
43
+ | [ ` 今時何時 ` ] ( ../lib/曆法.wy#L87 ) | ` Get index (1 to 12) of current time in the 12 divisions of day ` |
44
+ | [ ` 今時何小時 ` ] ( ../lib/曆法.wy#L94 ) | ` new Date().getHours() ` |
45
+ | [ ` 今刻何刻 ` ] ( ../lib/曆法.wy#L101 ) | ` Math.floor(new Date().getMinutes() / 15) ` |
46
+ | [ ` 今分何分 ` ] ( ../lib/曆法.wy#L108 ) | ` new Date().getMinutes() % 15 ` |
47
+ | [ ` 今秒何秒 ` ] ( ../lib/曆法.wy#L113 ) | ` new Date().getSeconds() ` |
48
+ | [ ` 言彼之日時 ` ] ( ../lib/曆法.wy#L232 ) | ` new Date(x * 1000).toString(), in Chinese calendar ` |
49
+ | [ ` 言彼之年月日 ` ] ( ../lib/曆法.wy#L241 ) | ` new Date(x * 1000).toDateString(), in Chinese calendar ` |
50
+ | [ ` 言彼之時刻 ` ] ( ../lib/曆法.wy#L248 ) | ` new Date(x * 1000).toTimeString(), in Chinese calendar ` |
51
+ | [ ` 彼年何年號 ` ] ( ../lib/曆法.wy#L255 ) | ` "西元" for modern dates ` |
52
+ | [ ` 彼年何年 ` ] ( ../lib/曆法.wy#L260 ) | ` new Date(x * 1000).getFullYear() for modern dates, in Chinese calendar ` |
53
+ | [ ` 彼年何干支 ` ] ( ../lib/曆法.wy#L265 ) | ` Get index (1 to 60) in the 60-year cycle ` |
54
+ | [ ` 彼年積何年 ` ] ( ../lib/曆法.wy#L271 ) | ` new Date(x * 1000).getFullYear() + 2697, in Chinese calendar ` |
55
+ | [ ` 彼月何月 ` ] ( ../lib/曆法.wy#L278 ) | ` new Date(x * 1000).getMonth() + 1, N + 0.5 for leap months, in Chinese calendar ` |
56
+ | [ ` 彼月積何月 ` ] ( ../lib/曆法.wy#L289 ) | ` Get continuously counting month number ` |
57
+ | [ ` 彼日何日 ` ] ( ../lib/曆法.wy#L294 ) | ` new Date(x * 1000).getDate(), in Chinese calendar ` |
58
+ | [ ` 彼日何干支 ` ] ( ../lib/曆法.wy#L300 ) | ` Get index (1 to 60) in the 60-day cycle ` |
59
+ | [ ` 彼日積何日 ` ] ( ../lib/曆法.wy#L306 ) | ` Get continuously counting day number ` |
60
+ | [ ` 彼時何時 ` ] ( ../lib/曆法.wy#L313 ) | ` Get index (1 to 12) in the 12 divisions of day ` |
61
+ | [ ` 彼時何小時 ` ] ( ../lib/曆法.wy#L322 ) | ` new Date(x * 1000).getHours() ` |
62
+ | [ ` 彼刻何刻 ` ] ( ../lib/曆法.wy#L330 ) | ` Math.floor(new Date(x * 1000).getMinutes() / 15) ` |
63
+ | [ ` 彼分何分 ` ] ( ../lib/曆法.wy#L338 ) | ` new Date(x * 1000).getMinutes() % 15 ` |
64
+ | [ ` 彼秒何秒 ` ] ( ../lib/曆法.wy#L346 ) | ` new Date(x * 1000).getSeconds() ` |
65
+
66
+ ## [ 曆表] ( ../lib/曆表.wy )
67
+
68
+ | Wenyan | Javascript Equivalent |
69
+ | ---| ---|
70
+
21
71
## [ 算經] ( ../lib/算經.wy )
22
72
23
73
| Wenyan | Javascript Equivalent |
@@ -35,24 +85,26 @@ Last updated: Mon, 30 Dec 2019 15:32:37 GMT
35
85
| [ ` 不可算數乎 ` ] ( ../lib/算經.wy#L190 ) | ` Number.isNaN ` |
36
86
| [ ` 浮點移位 ` ] ( ../lib/算經.wy#L392 ) | ` x * Math.pow(2, y), y is integer ` |
37
87
| [ ` 析浮點數 ` ] ( ../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 ` |
88
+ | [ ` 取底除 ` ] ( ../lib/算經.wy#L474 ) | ` { 商: Math.floor(x / y), 餘: x - y * quo } ` |
89
+ | [ ` 取整除 ` ] ( ../lib/算經.wy#L491 ) | ` { 商: Math.round(x / y), 餘: x - y * quo } ` |
90
+ | [ ` 正弦 ` ] ( ../lib/算經.wy#L565 ) | ` Math.sin ` |
91
+ | [ ` 餘弦 ` ] ( ../lib/算經.wy#L593 ) | ` Math.cos ` |
92
+ | [ ` 反正弦 ` ] ( ../lib/算經.wy#L621 ) | ` Math.asin ` |
93
+ | [ ` 反餘弦 ` ] ( ../lib/算經.wy#L648 ) | ` Math.acos ` |
94
+ | [ ` 正切 ` ] ( ../lib/算經.wy#L655 ) | ` Math.tan ` |
95
+ | [ ` 反正切 ` ] ( ../lib/算經.wy#L693 ) | ` Math.atan ` |
96
+ | [ ` 勾股求角 ` ] ( ../lib/算經.wy#L727 ) | ` Math.atan2 ` |
97
+ | [ ` 勾股求弦 ` ] ( ../lib/算經.wy#L745 ) | ` Math.hypot ` |
98
+ | [ ` 對數 ` ] ( ../lib/算經.wy#L782 ) | ` Math.log ` |
99
+ | [ ` 指數 ` ] ( ../lib/算經.wy#L825 ) | ` Math.exp ` |
100
+ | [ ` 冪 ` ] ( ../lib/算經.wy#L861 ) | ` Math.pow ` |
101
+ | [ ` 平方根 ` ] ( ../lib/算經.wy#L885 ) | ` Math.sqrt ` |
102
+ | [ ` 絕對 ` ] ( ../lib/算經.wy#L946 ) | ` Math.abs ` |
103
+ | [ ` 取頂 ` ] ( ../lib/算經.wy#L951 ) | ` Math.ceil ` |
104
+ | [ ` 取底 ` ] ( ../lib/算經.wy#L956 ) | ` Math.floor ` |
105
+ | [ ` 取整 ` ] ( ../lib/算經.wy#L971 ) | ` Math.round, but rounded away from zero when the fractional part is exactly 0.5 ` |
106
+ | [ ` 捨餘 ` ] ( ../lib/算經.wy#L985 ) | ` Math.trunc ` |
107
+ | [ ` 正負 ` ] ( ../lib/算經.wy#L995 ) | ` Math.sign ` |
56
108
57
109
## [ 籌經] ( ../lib/籌經.wy )
58
110
@@ -65,6 +117,16 @@ Last updated: Mon, 30 Dec 2019 15:32:37 GMT
65
117
| Wenyan | Javascript Equivalent |
66
118
| ---| ---|
67
119
120
+ ## [ 畫譜] ( ../lib/js/畫譜.wy )
121
+
122
+ | Wenyan | Javascript Equivalent |
123
+ | ---| ---|
124
+
125
+ ## [ 西曆法] ( ../lib/js/西曆法.wy )
126
+
127
+ | Wenyan | Javascript Equivalent |
128
+ | ---| ---|
129
+
68
130
69
131
70
132
0 commit comments