Rev 3307 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
20 | reyssat | 1 | !if $wims_read_parm!=slib_header |
2 | !goto proc |
||
3 | !endif |
||
4 | slib_title=Calcule les coordonnées des deux points extrêmes pour tracer une droite dans un repère |
||
5 | slib_parms=6\ |
||
6 | ,coefficient directeur de la droite\ |
||
7 | ,valeur à l'origine\ |
||
8 | ,abscisse minimale du repère\ |
||
9 | ,ordonnée minimale du repère\ |
||
10 | ,abscisse maximale du repère\ |
||
11 | ,ordonnée maximale du repère |
||
12 | slib_author=Fabrice Guerimand |
||
13 | slib_out=Deux lignes comportant chacune les coordonnées de l'un des points. |
||
14 | !exit |
||
15 | |||
16 | |||
17 | :proc |
||
18 | slib_input=$wims_read_parm |
||
19 | |||
20 | !distribute items $slib_input into a,b,mx,my,Mx,My |
||
21 | slib_out=$slib_input |
||
22 | |||
23 | liste=$empty |
||
24 | tmp=$[$mx*($a)+($b)] |
||
25 | !ifval $tmp<=$My and $tmp>=$my |
||
26 | liste=!append line $mx,$tmp to $liste |
||
27 | !endif |
||
28 | tmp=$[$Mx*($a)+($b)] |
||
29 | !ifval $tmp<=$My and $tmp>=$my |
||
30 | liste=!append line $Mx,$tmp to $liste |
||
31 | !endif |
||
32 | tmp=!linecnt $liste |
||
33 | !if $tmp=2 |
||
34 | !goto end |
||
35 | !endif |
||
36 | |||
37 | tmp=$[($my-($b))/($a)] |
||
38 | !ifval $tmp<=$Mx and $tmp>=$mx |
||
39 | liste=!append line $tmp,$my to $liste |
||
40 | !endif |
||
41 | |||
42 | tmp=$[($My-($b))/($a)] |
||
43 | !ifval $tmp<=$Mx and $tmp>=$mx |
||
44 | liste=!append line $tmp,$My to $liste |
||
45 | !endif |
||
46 | |||
47 | :end |
||
48 | |||
49 | |||
50 | tmp=!linecnt $liste |
||
51 | !if $tmp<2 |
||
52 | slib_out=error |
||
53 | !else |
||
54 | slib_out=!line 1 to 2 of $liste |
||
55 | !endif |