Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2071 | zjchen | 1 | !goto $wims_read_parm |
2 | |||
3 | :def |
||
4 | title=Plot implicit curve |
||
5 | synonyme=implicit plot, implicit curve plot, implicit curve 2D, plane implicit curve plot, plot plane implicit curve |
||
6 | input=equation |
||
7 | !exit |
||
8 | |||
9 | :proc |
||
10 | formula=!item 1 of $formula |
||
11 | fml=!mathsubst X=x in $fml |
||
12 | fml=!mathsubst Y=y in $fml |
||
13 | eq== |
||
14 | !if $eq isin $formula |
||
15 | f=!translate internal = to , in $formula |
||
16 | !distribute items $f into f1,f2 |
||
17 | !if $f2=$empty or $f1=$empty |
||
18 | error=bad_formula |
||
19 | !exit |
||
20 | !endif |
||
21 | fml=$f1 - ($f2) |
||
22 | !else |
||
23 | fml=$formula |
||
24 | !endif |
||
25 | result=$fml |
||
26 | x1=$[$xrange1] |
||
27 | x2=$[$xrange2] |
||
28 | y1=$[$yrange1] |
||
29 | y2=$[$yrange2] |
||
30 | s1=$[$picturesize1] |
||
31 | s2=$[$picturesize2] |
||
32 | !distribute item -2,2,-2,2,260,260 into dx1,dx2,dy1,dy2,ds1,ds2 |
||
33 | !for r in x1,x2,y1,y2,s1,s2 |
||
34 | !if NaN isin $($r) |
||
35 | $r= |
||
36 | !endif |
||
37 | !default $r=$(d$r) |
||
38 | !next r |
||
39 | insdraw_size=$s1,$s2 |
||
40 | !exit |
||
41 | |||
42 | :output |
||
43 | Plane implicit curve defined by |
||
44 | !htmlmath $formula |
||
45 | : |
||
46 | <p><center> |
||
47 | !insdraw xrange $x1,$x2\ |
||
48 | yrange $y1,$y2\ |
||
49 | arrow $x1,0,$x2,0,10,grey\ |
||
50 | arrow 0,$y1,0,$y2,10,grey\ |
||
51 | levelcurve red,$fml,0 |
||
52 | |||
53 | </center> |
||
54 | !exit |
||
55 |