File: javacurve.points

package info (click to toggle)
wims 2%3A4.29a%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 185,704 kB
  • sloc: xml: 366,687; javascript: 120,570; ansic: 62,341; java: 62,170; sh: 7,744; perl: 3,937; yacc: 3,217; cpp: 1,915; lex: 1,805; makefile: 1,084; lisp: 914; pascal: 601; python: 520; php: 318; asm: 7
file content (87 lines) | stat: -rw-r--r-- 2,141 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
!set precision=!getopt precision in $(replyoption$i)
!default precision=15

!if $n<1
  :badrep
  reply$i=
  test=NaN
  !exit
!endif
!if $wims_read_parm=nocompare
    m_reply$i =$rlist
    !goto drawing
!endif

!if $m<1
  Test=bad $i
  !exit
!endif

Bon1=0
correct=
!for si = 1 to $[$m/2]
  bon=0
  !for sj = 1 to $[$n/2]
    ecart= $[sqrt(($(glist[2*$si-1]) - ($(rlist[2*$sj-1])))^2 + ($(glist[2*$si]) - ($(rlist[2*$sj])))^2)]
    !if $ecart < $precision
      bon = 1
      correct = !append item $si to $correct
    !endif
  !next
  Bon1 = $[$Bon1 + $bon]
!next
correct= !listuniq $correct
trop1 = $[$n/2 -$Bon1]
trop = $[($n -2*$Bon1)/$m]
manque1 = $[$m/2 - $Bon1]
manque= $[1 - 2*$Bon1/$m]
Bon = $[2*$Bon1/$m]

!if NaN isin $Bon or Inf isin $Bon
  !goto badrep
!endif

:diag

!if $trop=0 and $manque=0
  diareply$i=good
  !advance freegot
!else
  freegot=$[$freegot + max(0,$Bon - $trop)]
  !ifval $Bon > $trop + $manque
    partialgood$i=yes
    diareply$i=good
  !else
    diareply$i=bad
  !endif
!endif
##coordonnes des points cliqus en pixels
##nombre de bons points, nombre de points oublis, nombre de points en trop,
##numro des points corrects
m_reply$i =$rlist;$Bon1,$manque1,$trop1;$correct

:drawing

!if $(replytype$i)=javacurve
  primitive1=linewidth 1
  !for si = 1 to $[$n/2]
    primitive1=$primitive1\
line $[$(rlist[2*$si-1])-6],$[$(rlist[2*$si])-6], $[$(rlist[2*$si-1])+6],$[$(rlist[2*$si])+6], $color1\
line $[$(rlist[2*$si-1])+6],$[$(rlist[2*$si])-6], $[$(rlist[2*$si-1])-6],$[$(rlist[2*$si])+6], $color1
  !next
  !if $wims_read_parm!=nocompare
    primitive2=linewidth 8\
points $color2,$glist
  !endif
  !exit
!endif

!! $(replytype$i)=jsxgraphcurve
!if $wims_read_parm!=nocompare
  !for j=1 to $m/2
    script$i=!append line brd$i.create('point',[$(glist[2*$j-1]),$(glist[2*$j])],{face:'o', size:'8',fixed:true,name:'',strokeColor:'$color2',fillColor:'none' ,showInfobox:false}); to $(script$i)
  !next
!endif
!for j=1 to $n/2
  script$i=!append line brd$i.create('point',[$(rlist[2*$j-1]),$(rlist[2*$j])],{face:'+', size:'8',fixed:true,name:'',strokeColor:'$color1',showInfobox:false}); to $(script$i)
!next