Subversion Repositories wimsdev

Rev

Rev 20 | Rev 4162 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 20 Rev 475
Line 10... Line 10...
10
1,x_step (delta x for 1 cm on the paper or max value for x and optional label ) \
10
1,x_step (delta x for 1 cm on the paper or max value for x and optional label ) \
11
1,y_step (delta y for 1 cm on the paper or max value for y and optional label) \
11
1,y_step (delta y for 1 cm on the paper or max value for y and optional label) \
12
[240,233,255],background color \
12
[240,233,255],background color \
13
[255,220,180],lines color \
13
[255,220,180],lines color \
14
[10,10,10],dots color \
14
[10,10,10],dots color \
15
void, function f(x) to be plotted \
15
void, function f(x) or [x(t), y(t)] to be plotted \
16
[], list of dots enclosed in brackets (the correct plot)\
16
[], list of dots enclosed in brackets (the correct plot)\
17
void,list of dots (an even count of coordinates : x1,y1,x2,y2,etc.)
17
void,list of dots (an even count of coordinates : x1,y1,x2,y2,etc.)
18
slib_author=Georges KHAZNADAR
18
slib_author=Georges KHAZNADAR
19
slib_out=Source for insdraw-ing a graph paper with the dots on it
19
slib_out=Source for insdraw-ing a graph paper with the dots on it
20
slib_comment=if color are three numbers, \
20
slib_comment=if color are three numbers, \
21
put them in brackets ; there may be no dots.<br>\
21
put them in brackets ; there may be no dots.<br>\
22
See the other syntaxes in the slib graphpaper/millimetre
22
See the other syntaxes in the slib graphpaper/millimetre
23
slib_example= ,,,,,,,,,sin(x),[],0,0,1.2,1.5,2.4,3.2\
23
slib_example= ,,,,,,,,,sin(x),[],0,0,1.2,1.5,2.4,3.2\
24
12,8,0,0,1 max t (ms),1 max U (V),blue,red,[255,128,128],sin(x),[0,0,1.3,1.4,2.5,3],0,0,1.2,1.5,2.4,3.2 
24
12,8,0,0,1 max t (ms),1 max U (V),blue,red,[255,128,128],sin(x),[0,0,1.3,1.4,2.5,3],0,0,1.2,1.5,2.4,3.2 \
-
 
25
,,,,,,,,,[cos(6.28*t),sin(6.28*t)],[],0,0,1.2,1.5,2.4,3.2
25
 
26
 
26
 
27
 
27
!exit
28
!exit
28
 
29
 
29
:proc
30
:proc
Line 41... Line 42...
41
!default slib_xo=1
42
!default slib_xo=1
42
!default slib_yo=1
43
!default slib_yo=1
43
!default slib_xs=1
44
!default slib_xs=1
44
!default slib_ys=1
45
!default slib_ys=1
45
!default slib_correct=[]
46
!default slib_correct=[]
-
 
47
 
-
 
48
slib_f = !declosing $slib_f
46
 
49
 
47
slib_labx=!word 2 to -1 of $slib_xs
50
slib_labx=!word 2 to -1 of $slib_xs
48
slib_laby=!word 2 to -1 of $slib_ys
51
slib_laby=!word 2 to -1 of $slib_ys
49
slib_xs=!word 1 of $slib_xs
52
slib_xs=!word 1 of $slib_xs
50
slib_ys=!word 1 of $slib_ys
53
slib_ys=!word 1 of $slib_ys
Line 61... Line 64...
61
  slib_log=$[log10($slib_xs/($slib_xd-$slib_xo))]
64
  slib_log=$[log10($slib_xs/($slib_xd-$slib_xo))]
62
  slib_logint=$[floor($slib_log)]
65
  slib_logint=$[floor($slib_log)]
63
  slib_logmant=$[$slib_log-$slib_logint]
66
  slib_logmant=$[$slib_log-$slib_logint]
64
  !if $slib_logmant > $[log10(5)]
67
  !if $slib_logmant > $[log10(5)]
65
     slib_xs=1e$[$slib_logint+1]
68
     slib_xs=1e$[$slib_logint+1]
66
  !else
69
  !else
67
    !if $slib_logmant > $[log10(2)]
70
    !if $slib_logmant > $[log10(2)]
68
      slib_xs=5e$slib_logint
71
      slib_xs=5e$slib_logint
69
    !else
72
    !else
70
      slib_xs=2e$slib_logint
73
      slib_xs=2e$slib_logint
71
    !endif
74
    !endif
Line 119... Line 122...
119
 
122
 
120
slib_dessin = new 60*$slib_xd,60*$slib_yd\
123
slib_dessin = new 60*$slib_xd,60*$slib_yd\
121
xrange -0.5, 10*$slib_xd-0.5\
124
xrange -0.5, 10*$slib_xd-0.5\
122
yrange -0.5, 10*$slib_yd-0.5\
125
yrange -0.5, 10*$slib_yd-0.5\
123
fill 1,1,$slib_bg
126
fill 1,1,$slib_bg
124
 
127
 
125
!! traits fins tous les millimetres
128
!! traits fins tous les millimetres
126
slib_dessin=$slib_dessin\
129
slib_dessin=$slib_dessin\
127
linewidth 1\
130
linewidth 1\
128
parallel 0, 0, 0, 10*$slib_yd, 1, 0, 10*$slib_xd+1, $slib_lc\
131
parallel 0, 0, 0, 10*$slib_yd, 1, 0, 10*$slib_xd+1, $slib_lc\
129
parallel 0, 0, 10*$slib_xd, 0, 0, 1, 10*$slib_yd+1, $slib_lc
132
parallel 0, 0, 10*$slib_xd, 0, 0, 1, 10*$slib_yd+1, $slib_lc
Line 197... Line 200...
197
 line $slib_x2,$slib_y1,$slib_x1,$slib_y2,red
200
 line $slib_x2,$slib_y1,$slib_x1,$slib_y2,red
198
!endif $i < $n1
201
!endif $i < $n1
199
!next i
202
!next i
200
 
203
 
201
!! the function : blue thin curve
204
!! the function : blue thin curve
-
 
205
slib_n = !itemcnt $slib_f
-
 
206
!if $slib_n = 1
202
slib_f = !replace internal x by ($slib_xs/10*(x-10*$slib_xo)) in $slib_f
207
  slib_f = !replace internal x by ($slib_xs/10*(x-10*$slib_xo)) in $slib_f
203
slib_f = 10*($slib_f)/$slib_ys+10*$slib_yo
208
  slib_f = 10*($slib_f)/$slib_ys+10*$slib_yo
-
 
209
!else
-
 
210
  slib_x = !item 1 of $slib_f
-
 
211
  slib_y = !item 2 of $slib_f
-
 
212
  slib_x = 10*($slib_x/$slib_xs+$slib_xo)
-
 
213
  slib_y = 10*($slib_y/$slib_ys+$slib_yo)
-
 
214
  slib_f = $slib_x, $slib_y
-
 
215
!endif
-
 
216
 
204
slib_dessin=$slib_dessin\
217
slib_dessin=$slib_dessin\
205
plot blue, $slib_f
218
plot blue, $slib_f
206
 
219
 
207
!! black dots
220
!! black dots
208
n2=!itemcnt $slib_point
221
n2=!itemcnt $slib_point