Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
152 | bpr | 1 | !if $lang=cn |
2 | <p><center><h2>参数函数表</h2></center> |
||
3 | |||
4 | <p>$table_header |
||
5 | <caption>随机化</caption> |
||
6 | $table_tr<th>函数<th>效果 |
||
7 | $table_tr<td><tt>random(-5..5) |
||
8 | <td>-5 与 5 之间的随机数 |
||
9 | $table_tr<td><tt>randint(-5..5) |
||
10 | <td>-5 与 5 之间的随机整数(包括两端) |
||
11 | $table_tr<td><tt>random(1,2,3,a,b,c) |
||
12 | <td>{1,2,3,a,b,c} 里随机选一项 |
||
13 | $table_tr<td><tt>shuffle(6) |
||
14 | <td>6 个整数 1,2,...,6, 的随机排列. |
||
15 | $table_tr<td><tt>shuffle(a,b,c,d,e) |
||
16 | <td>字母 {a,b,c,d,e} 的随机排列. |
||
17 | $table_tr<td><tt>randomitem(\list) |
||
18 | <td>在(逗号分隔的)表 \list 内随机选一项. |
||
19 | $table_tr<td><tt>randomrow(\mat) |
||
20 | <td>矩阵 \mat 内随机选一行. |
||
21 | $table_end |
||
22 | <p>$table_header |
||
23 | <caption>数据与表的操作</caption> |
||
24 | $table_tr<td><tt>items(a,b,c,d,e,f) |
||
25 | <td>表 {a,b,c,d,e,f} 的项数(这里是 6) |
||
26 | $table_tr<td><tt>item(3,a,b,c,d,e,f) |
||
27 | <td>表 {a,b,c,d,e,f} 的第 3 项(这里是 c) |
||
28 | $table_tr<td><tt>item(3,\ll) |
||
29 | <td>表 \ll 的第 3 项(同 <tt>\ll[3]</tt>) |
||
30 | $table_tr<td><tt>item(2..5,a,b,c,d,e,f) |
||
31 | <td>表 {a,b,c,d,e,f} 的第 2 至 5 项(这里是 b,c,d,e) |
||
32 | $table_tr<td><tt>item([2,4],\ll) |
||
33 | <td>表 \ll 的第 2 及第 4 项(同 <tt>\ll[2,4]</tt>) |
||
34 | $table_tr<td><tt>position(make,do,go,make,take) |
||
35 | <td>项 `make' 在表 {do,go,make,take} 里的位置(这里是 3) |
||
36 | $table_tr<td><tt>rows(\m) |
||
37 | <td>矩阵 \m 的行数 |
||
38 | $table_tr<td><tt>row(2,\m) |
||
39 | <td>矩阵 \m 的第 2 行(同 <tt>\m[2;]</tt>) |
||
40 | $table_tr<td><tt>row(2..5,\m) |
||
41 | <td>矩阵 \m 的第 2 至 5 行构成的子矩阵(同 <tt>\m[2..5;]</tt>) |
||
42 | $table_tr<td><tt>row([1,3],1,2,3<br>3,4,5<br>5,6,7) |
||
43 | <td>由 3×3 矩阵的第 1, 3 行构成的子矩阵 |
||
44 | $table_tr<td><tt>row(column 1 > 1 and column 2 = good,\mat) |
||
45 | <td>\mat 的子矩阵, 其中每行的第 1 列 > 1, 第 2 列是词 `good' |
||
46 | $table_tr<td><tt>randomitem(\list) |
||
47 | <td>(用逗号分隔的)表 \list 的随机项. |
||
48 | $table_tr<td><tt>randomrow(\mat) |
||
49 | <td>矩阵 \mat 的随机行. |
||
50 | $table_tr<td><tt>column(2,\m) |
||
51 | <td>矩阵 \m 的第 2 列元素, 作为用逗号分隔的表(同 <tt>\m[;2]</tt>) |
||
52 | $table_tr<td><tt>column(2..5,\m) |
||
53 | <td>\m 的第 2 至 5 列构成的子矩阵(同 <tt>\m[;2..5]</tt>) |
||
54 | $table_tr<td><tt>column([1,3],1,2,3<br>3,4,5<br>5,6,7) |
||
55 | <td>由 3×3 矩阵的 1, 3 列构成的子矩阵 |
||
56 | |||
57 | $table_end<p>$table_header |
||
58 | <caption>数学函数</caption> |
||
59 | $table_tr<td><tt>evalue(x^2+sin(y),x=3,y=4) |
||
60 | <td>函数 x^2+sin(y)在 x=3, y=4 处赋值 |
||
61 | $table_tr<td><tt>solve(x^3-3*x+1,x=0..1) |
||
62 | <td>x^3-3x+1 在 0 与 1 间的单根 |
||
63 | $table_tr<td><tt>simplify(x^5*y^3/x^2/y) |
||
64 | <td>化简: x<sup>3</sup>y<sup>2</sup> |
||
65 | $table_tr<td><tt>diff(sin(x)+cos(y),x) |
||
66 | <td>sin(x)+cos(y) 关于 x 的导数 |
||
67 | $table_tr<td><tt>int(x^2+3*x+1,x) |
||
68 | <td>x^2+3*x+1 的原函数, 常数项不定 |
||
69 | !!$table_tr<td><tt>int(t^2+3*t+1,t=1..x) |
||
70 | !! <td>x^2+3*x+1 的原函数 g, 满足 g(1)=0 |
||
71 | $table_tr<td><tt>int(t^2+3*t+1,t=0..1) |
||
72 | <td>x^2+3*x+1 从 0 到 1 的数值积分 |
||
73 | $table_tr<td><tt>det(\mat) |
||
74 | <td>矩阵 \mat 的行列式 |
||
75 | $table_tr<td><tt>htmlmath(2*x^2+3*x) |
||
76 | <td>html 格式下此公式的最佳形式: 2x<sup>2</sup>+3x |
||
77 | $table_tr<td><tt>texmath(2*x^2+3*x) |
||
78 | <td>表达式的TeX源码 |
||
79 | |||
80 | $table_end<p>$table_header |
||
81 | <caption>高级功能</caption> |
||
82 | $table_tr<td><tt>pari(factor(2^101-1)) |
||
83 | <td>调用 PARI/GP: 这里是分解整数 |
||
84 | $table_tr<td><tt>maxima(integrate(x^2+1,x);) |
||
85 | <td>调用 Maxima: 这里是积分一个函数 |
||
86 | $table_tr<td><tt>yacas(Taylor(x,0,10) cos(x^2+x+1)) |
||
87 | <td>调用 Yacas: 这里是计算Taylor展开式 |
||
88 | $table_tr<td><tt>wims(sort items \list) |
||
89 | <td>调用 wims 的 !sort 命令对表 \list 的项排序 |
||
90 | $table_tr<td><tt>wims(listintersect \list1 and \list2) |
||
91 | <td>调用 wims 的 !listintersect 命令得到 \list1 与 \list2 的公共项 |
||
92 | $table_tr<td><tt>draw(绘图源码 ...) |
||
93 | <td>画一个图, 绘图源码同 <tt>\draw</tt>, |
||
94 | 第 1 行是图形大小. 输出是图形的 URL. |
||
95 | $table_tr<td><tt>slib(matrix/invertible 3,5) |
||
96 | <td>读入 |
||
97 | !href module=help/wimsdoc&subject=slib#slib WIMS slib |
||
98 | 的 matrix/invertible 以生成一个可逆 3x3 矩阵, 元素取值范围 5. |
||
99 | $table_end |
||
100 | |||
101 | <p> |
||
102 | 可用的参数类型: integer(整数), real(实数), complex(复数), function(函数), text(文字), matrix(矩阵). |
||
103 | <p> |
||
104 | !exit |
||
105 | !endif |
||
106 | |||
20 | reyssat | 107 | <p><center><h2>Complete list of parameter functions</h2></center> |
108 | |||
109 | <p>$table_header |
||
110 | <caption>Randomization</caption> |
||
74 | bpr | 111 | $table_tr<th>Function</th><th>Effect</th></tr> |
112 | $table_tr<td><tt>random(-5..5)</tt> |
||
113 | </td><td>a random number between -5 and 5</td></tr> |
||
114 | $table_tr<td><tt>randint(-5..5)</tt> |
||
115 | </td><td>a random integer between -5 and 5 (inclusive)</td></tr> |
||
116 | $table_tr<td><tt>random(1,2,3,a,b,c)</tt> |
||
117 | </td><td>a random item within {1,2,3,a,b,c}</td></tr> |
||
118 | $table_tr<td><tt>shuffle(6)</tt> |
||
119 | </td><td>a list of 6 integers 1,2,...,6, in a random order.</td></tr> |
||
120 | $table_tr<td><tt>shuffle(a,b,c,d,e)</tt> |
||
121 | </td><td>the list of letters {a,b,c,d,e}, in a random order.</td></tr> |
||
122 | $table_tr<td><tt>randomitem(\list)</tt> |
||
123 | </td><td>a random item of (comma-separated) \list.</td></tr> |
||
124 | $table_tr<td><tt>randomrow(\mat)</tt> |
||
125 | </td><td>a random row of the matrix \mat. |
||
20 | reyssat | 126 | $table_end |
127 | <p>$table_header |
||
128 | <caption>Data and list manipulation</caption> |
||
74 | bpr | 129 | $table_tr<td><tt>items(a,b,c,d,e,f)</tt> |
130 | </td><td>the number of items (here it's 6) in the list |
||
131 | {a,b,c,d,e,f}</td></tr> |
||
132 | $table_tr<td><tt>item(3,a,b,c,d,e,f)</tt> |
||
133 | </td><td>item number 3 of the list {a,b,c,d,e,f} (hence c)</td></tr> |
||
134 | $table_tr<td><tt>item(3,\ll)</tt> |
||
135 | </td><td>item number 3 of the list \ll (same as <tt>\ll[3]</tt>)</td></tr> |
||
136 | $table_tr<td><tt>item(2..5,a,b,c,d,e,f)</tt> |
||
137 | </td><td>items number 2 to 5 of the list {a,b,c,d,e,f} (hence b,c,d,e)</td></tr> |
||
138 | $table_tr<td><tt>item([2,4],\ll)</tt> |
||
139 | </td><td>items number 2 and 4 of the list \ll (same as |
||
140 | <tt>\ll[2,4]</tt>)</td></tr> |
||
141 | $table_tr<td><tt>position(make,do,go,make,take)</tt> |
||
142 | </td><td>number of position of the item `make' in the list |
||
143 | {do,go,make,take} (hence 3)</td></tr> |
||
144 | $table_tr<td><tt>rows(\m)</tt> |
||
145 | </td><td>the number of rows in the matrix \m</td></tr> |
||
146 | $table_tr<td><tt>row(2,\m)</tt> |
||
147 | </td><td>row number 2 of the matrix \m (same as <tt>\m[2;]</tt>)</td></tr> |
||
148 | $table_tr<td><tt>row(2..5,\m)</tt> |
||
149 | </td><td>the submatrix of \m consisting of rows number 2 to 5 |
||
150 | (same as <tt>\m[2..5;]</tt>)</td></tr> |
||
20 | reyssat | 151 | $table_tr<td><tt>row([1,3],1,2,3<br>3,4,5<br>5,6,7) |
74 | bpr | 152 | </td><td>the submatrix of the 3×3 matrix consisting of the first |
153 | and the last rows</td></tr> |
||
154 | $table_tr<td><tt>row(column 1 > 1 and column 2 = good,\mat)</tt> |
||
155 | </td><td>the submatrix of \mat consisting of rows where column 1 is > 1 and |
||
156 | column 2 is the word `good'</td></tr> |
||
157 | $table_tr<td><tt>randomitem(\list)</tt> |
||
158 | </td><td>a random item of (comma-separated) \list.</td></tr> |
||
159 | $table_tr<td><tt>randomrow(\mat)</tt> |
||
160 | </td><td>a random row of the matrix \mat.</td></tr> |
||
161 | $table_tr<td><tt>column(2,\m)</tt> |
||
162 | </td><td>items of column number 2 of the matrix \m, |
||
163 | as a comma-separated list (same as <tt>\m[;2]</tt>)</td></tr> |
||
164 | $table_tr<td><tt>column(2..5,\m)</tt> |
||
165 | </td><td>the submatrix of \m consisting of columns number 2 to 5 |
||
166 | (same as <tt>\m[;2..5]</tt>)</td></tr> |
||
20 | reyssat | 167 | $table_tr<td><tt>column([1,3],1,2,3<br>3,4,5<br>5,6,7) |
74 | bpr | 168 | </td><td>the submatrix of the 3×3 matrix consisting of the first |
169 | and the last columns</td></tr> |
||
170 | $table_tr<td><tt>asis(How do you do? item(1,2,3))</tt> |
||
171 | </td><td>the string as it is, protected from transformations and conditionality. |
||
20 | reyssat | 172 | |
173 | $table_end<p>$table_header |
||
74 | bpr | 174 | <caption>Mathematical functions</caption></td></tr> |
175 | $table_tr<td><tt>evalue(x^2+sin(y),x=3,y=4)</tt> |
||
176 | </td><td>evaluation of the function x^2+sin(y),<br> |
||
177 | for x=3, y=4</td></tr> |
||
178 | $table_tr<td><tt>solve(x^3-3*x+1,x=0..1)</tt> |
||
179 | </td><td>the simple root of x^3-3x+1 between 0 and 1</td></tr> |
||
180 | $table_tr<td><tt>simplify(x^5*y^3*x^2/y)</tt> |
||
181 | </td><td>simplified expression: x<sup>7</sup>y<sup>2</sup></td></tr> |
||
182 | $table_tr<td><tt>diff(sin(x)+cos(y),x)</tt> |
||
183 | </td><td>the derivative of sin(x)+cos(y) with respect to x</td></tr> |
||
184 | $table_tr<td><tt>int(x^2+3*x+1,x)</tt> |
||
185 | </td><td>anti-derivative of x^2+3*x+1,<br> |
||
186 | the constant term being undertermined</td></tr> |
||
20 | reyssat | 187 | !!$table_tr<td><tt>int(t^2+3*t+1,t=1..x) |
188 | !! <td>the anti-derivative g of x^2+3*x+1 such that g(1)=0 |
||
189 | $table_tr<td><tt>int(t^2+3*t+1,t=0..1) |
||
74 | bpr | 190 | </td><td>the numerical integration of x^2+3*x+1, from 0 to 1</td></tr> |
191 | $table_tr<td><tt>det(\mat)</tt> |
||
192 | </td><td>determinant of the matrix \mat</td></tr> |
||
193 | $table_tr<td><tt>htmlmath(2*x^2+3*x)</tt> |
||
194 | </td><td>the best possible way to render the expression<br> |
||
195 | in html way: 2x<sup>2</sup>+3x</td></tr> |
||
196 | $table_tr<td><tt>texmath(2*x^2+3*x)</tt> |
||
197 | </td><td>the TeX source of the expression</td></tr> |
||
20 | reyssat | 198 | |
199 | $table_end<p>$table_header |
||
200 | <caption>Advanced facilities</caption> |
||
74 | bpr | 201 | $table_tr<td><tt>pari(factor(2^101-1))</tt> |
202 | </td><td>call PARI/GP: here to factor an integer</td></tr> |
||
203 | $table_tr<td><tt>maxima(integrate(x^2+1,x);)</tt> |
||
204 | </td><td>call Maxima: here to integrate a function</td></tr> |
||
205 | $table_tr<td><tt>yacas(Taylor(x,0,10) cos(x^2+x+1))</tt> |
||
206 | </td><td>call Yacas: here to compute a Taylor expansion</td></tr> |
||
207 | $table_tr<td><tt>wims(sort items \list)</tt> |
||
208 | </td><td>use wims !sort command to sort items in the list \list</td></tr> |
||
209 | $table_tr<td><tt>wims(listintersect \list1 and \list2)</tt> |
||
210 | </td><td>use wims !listintersect command to get the common items of |
||
211 | \list1 and \list2</td></tr> |
||
212 | $table_tr<td><tt>draw(pixel_size_x,pixel_size_y<br>draw_source)</tt> |
||
213 | </td><td>draw a picture, the source is the same as in <tt>\draw</tt>, |
||
20 | reyssat | 214 | with the image size as the first line. |
74 | bpr | 215 | The output is an image URL.</td></tr> |
216 | $table_tr<td><tt>slib(matrix/invertible 3,5)</tt> |
||
217 | </td><td>Read |
||
20 | reyssat | 218 | !href module=help/wimsdoc&subject=slib#slib WIMS slib |
219 | matrix/invertible to generate an invertible 3x3 |
||
74 | bpr | 220 | matrix of range 5.</td></tr> |
20 | reyssat | 221 | $table_end |
222 | |||
223 | <p> |
||
224 | Available types of parameters: integer, real, complex, function, text, matrix. |
||
225 | <p> |
||
226 | |||
152 | bpr | 227 |