Subversion Repositories wimsdev

Rev

Rev 404 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 404 Rev 3263
Line 1... Line -...
1
 
-
 
2
<p><center><h2>Complete list of parameter functions</h2></center>
1
Complete list of parameter functions
3
 
-
 
4
<p>$table_header
-
 
5
<caption>Randomization</caption>
-
 
6
$table_tr<th>Function</th><th>Effect</th></tr>
-
 
7
$table_tr<td><tt>random(-5..5)</tt>
-
 
8
    </td><td>a random number between -5 and 5</td></tr>
-
 
9
$table_tr<td><tt>randint(-5..5)</tt>
-
 
10
    </td><td>a random integer between -5 and 5 (inclusive)</td></tr>
-
 
11
$table_tr<td><tt>random(1,2,3,a,b,c)</tt>
-
 
12
    </td><td>a random item within {1,2,3,a,b,c}</td></tr>
-
 
13
$table_tr<td><tt>shuffle(6)</tt>
-
 
14
    </td><td>a list of 6 integers 1,2,...,6, in a random order.</td></tr>
-
 
15
$table_tr<td><tt>shuffle(a,b,c,d,e)</tt>
-
 
16
    </td><td>the list of letters {a,b,c,d,e}, in a random order.</td></tr>
-
 
17
$table_tr<td><tt>randomitem(\list)</tt>
-
 
18
    </td><td>a random item of (comma-separated) \list.</td></tr>
-
 
19
$table_tr<td><tt>randomrow(\mat)</tt>
-
 
20
    </td><td>a random row of the matrix \mat.
-
 
21
$table_end
-
 
22
<p>$table_header
-
 
23
<caption>Data and list manipulation</caption>
-
 
24
$table_tr<td><tt>items(a,b,c,d,e,f)</tt>
-
 
25
    </td><td>the number of items (here it's 6) in the list
-
 
26
     {a,b,c,d,e,f}</td></tr>
-
 
27
$table_tr<td><tt>item(3,a,b,c,d,e,f)</tt>
-
 
28
    </td><td>item number 3 of the list {a,b,c,d,e,f} (hence c)</td></tr>
-
 
29
$table_tr<td><tt>item(3,\ll)</tt>
-
 
30
    </td><td>item number 3 of the list \ll (same as <tt>\ll[3]</tt>)</td></tr>
-
 
31
$table_tr<td><tt>item(2..5,a,b,c,d,e,f)</tt>
-
 
32
    </td><td>items number 2 to 5 of the list {a,b,c,d,e,f} (hence b,c,d,e)</td></tr>
-
 
33
$table_tr<td><tt>item([2,4],\ll)</tt>
-
 
34
    </td><td>items number 2 and 4 of the list \ll (same as
-
 
35
    <tt>\ll[2,4]</tt>)</td></tr>
-
 
36
$table_tr<td><tt>position(make,do,go,make,take)</tt>
-
 
37
    </td><td>number of position of the item `make' in the list
-
 
38
    {do,go,make,take} (hence 3)</td></tr>
-
 
39
$table_tr<td><tt>rows(\m)</tt>
-
 
40
    </td><td>the number of rows in the matrix \m</td></tr>
-
 
41
$table_tr<td><tt>row(2,\m)</tt>
-
 
42
    </td><td>row number 2 of the matrix \m (same as <tt>\m[2;]</tt>)</td></tr>
-
 
43
$table_tr<td><tt>row(2..5,\m)</tt>
-
 
44
    </td><td>the submatrix of \m consisting of rows number 2 to 5
-
 
45
    (same as <tt>\m[2..5;]</tt>)</td></tr>
-
 
46
$table_tr<td><tt>row([1,3],1,2,3<br>3,4,5<br>5,6,7)
-
 
47
    </td><td>the submatrix of the 3&times;3 matrix consisting of the first
-
 
48
    and the last rows</td></tr>
-
 
49
$table_tr<td><tt>row(column 1 > 1 and column 2 = good,\mat)</tt>
-
 
50
    </td><td>the submatrix of \mat consisting of rows where column 1 is > 1 and
-
 
51
    column 2 is the word `good'</td></tr>
-
 
52
$table_tr<td><tt>randomitem(\list)</tt>
-
 
53
    </td><td>a random item of (comma-separated) \list.</td></tr>
-
 
54
$table_tr<td><tt>randomrow(\mat)</tt>
-
 
55
    </td><td>a random row of the matrix \mat.</td></tr>
-
 
56
$table_tr<td><tt>column(2,\m)</tt>
-
 
57
    </td><td>items of column number 2 of the matrix \m,
-
 
58
    as a comma-separated list (same as <tt>\m[;2]</tt>)</td></tr>
-
 
59
$table_tr<td><tt>column(2..5,\m)</tt>
-
 
60
    </td><td>the submatrix of \m consisting of columns number 2 to 5
-
 
61
    (same as <tt>\m[;2..5]</tt>)</td></tr>
-
 
62
$table_tr<td><tt>column([1,3],1,2,3<br>3,4,5<br>5,6,7)
-
 
63
    </td><td>the submatrix of the 3&times;3 matrix consisting of the first
-
 
64
    and the last columns</td></tr>
-
 
65
$table_tr<td><tt>asis(How do you do? item(1,2,3))</tt>
-
 
66
    </td><td>the string as it is, protected from transformations and conditionality.
-
 
67
 
-
 
68
$table_end<p>$table_header
-
 
69
<caption>Mathematical functions</caption></td></tr>
-
 
70
$table_tr<td><tt>evalue(x^2+sin(y),x=3,y=4)</tt>
-
 
71
    </td><td>evaluation of the function x^2+sin(y),<br>
-
 
72
    for x=3, y=4</td></tr>
-
 
73
$table_tr<td><tt>solve(x^3-3*x+1,x=0..1)</tt>
-
 
74
    </td><td>the simple root of x^3-3x+1 between 0 and 1</td></tr>
-
 
75
$table_tr<td><tt>simplify(x^5*y^3*x^2/y)</tt>
-
 
76
    </td><td>simplified expression: x<sup>7</sup>y<sup>2</sup></td></tr>
-
 
77
$table_tr<td><tt>diff(sin(x)+cos(y),x)</tt>
-
 
78
    </td><td>the derivative of sin(x)+cos(y) with respect to x</td></tr>
-
 
79
$table_tr<td><tt>int(x^2+3*x+1,x)</tt>
-
 
80
    </td><td>anti-derivative of x^2+3*x+1,<br>
-
 
81
     the constant term being undertermined</td></tr>
-
 
82
!!$table_tr<td><tt>int(t^2+3*t+1,t=1..x)
-
 
83
!!    <td>the anti-derivative g of x^2+3*x+1 such that g(1)=0
-
 
84
$table_tr<td><tt>int(t^2+3*t+1,t=0..1)
-
 
85
    </td><td>the numerical integration of x^2+3*x+1, from 0 to 1</td></tr>
-
 
86
$table_tr<td><tt>det(\mat)</tt>
-
 
87
    </td><td>determinant of the matrix \mat</td></tr>
-
 
88
$table_tr<td><tt>htmlmath(2*x^2+3*x)</tt>
-
 
89
    </td><td>the best possible way to render the expression<br>
-
 
90
    in html way: 2x<sup>2</sup>+3x</td></tr>
-
 
91
$table_tr<td><tt>texmath(2*x^2+3*x)</tt>
-
 
92
    </td><td>the TeX source of the expression</td></tr>
-
 
93
 
-
 
94
$table_end<p>$table_header
-
 
95
<caption>Advanced facilities</caption>
-
 
96
$table_tr<td><tt>pari(factor(2^101-1))</tt>
-
 
97
    </td><td>call PARI/GP: here to factor an integer</td></tr>
-
 
98
$table_tr<td><tt>maxima(integrate(x^2+1,x);)</tt>
-
 
99
    </td><td>call Maxima: here to integrate a function</td></tr>
-
 
100
$table_tr<td><tt>yacas(Taylor(x,0,10) cos(x^2+x+1))</tt>
-
 
101
    </td><td>call Yacas: here to compute a Taylor expansion</td></tr>
-
 
102
$table_tr<td><tt>wims(sort items \list)</tt>
-
 
103
    </td><td>use wims !sort command to sort items in the list \list</td></tr>
-
 
104
$table_tr<td><tt>wims(listintersect \list1 and \list2)</tt>
-
 
105
    </td><td>use wims !listintersect command to get the common items of
-
 
106
    \list1 and \list2</td></tr>
-
 
107
$table_tr<td><tt>draw(pixel_size_x,pixel_size_y<br>draw_source)</tt>
-
 
108
    </td><td>draw a picture, the source is the same as in <tt>\draw</tt>,
-
 
109
    with the image size as the first line.
-
 
110
    The output is an image URL.</td></tr>
-
 
111
$table_tr<td><tt>slib(matrix/invertible 3,5)</tt>
-
 
112
    </td><td>Read
-
 
113
    !href module=help/wimsdoc&subject=slib#slib WIMS slib
-
 
114
    matrix/invertible to generate an invertible 3x3
-
 
115
    matrix of range 5.</td></tr>
-
 
116
$table_end
-
 
117
 
-
 
118
<p>
-
 
119
Available types of parameters: integer, real, rational, complex, function, text, matrix.
-
 
120
<p>
-
 
121
 
-
 
122
 
-