File: rosette

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 (71 lines) | stat: -rw-r--r-- 2,671 bytes parent folder | download | duplicates (3)
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

!if $wims_read_parm!=slib_header
  !goto proc
!endif

slib_title=Rosettes
slib_author=Marina, Cazzola
slib_example=cn,3,0,[segment 0.8,0,1,1,blue],html\
dn,3,0,[segment 0.8,0,1,1,blue],html\
cn,1,0,[segment 0,0,1.4,0,blue;segment 1.4,0,1.4,1.4,blue;segment 0,0,1.4,1.4,red],html\
cn,1,90,[segment 0,0,1.4,0,blue;segment 1.4,0,1.4,1.4,blue;segment 0,0,1.4,1.4,red],html\
cn,2,0,[segment 0,0,1.4,0,blue;segment 1.4,0,1.4,1.4,blue;segment 0,0,1.4,1.4,red],html\
cn,3,0,[segment 0,0,1.4,0,blue;segment 1.4,0,1.4,1.4,blue;segment 0,0,1.4,1.4,red],html\
cn,4,0,[segment 0,0,1.4,0,blue;segment 1.4,0,1.4,1.4,blue;segment 0,0,1.4,1.4,red],html\
cn,5,0,[segment 0,0,1.4,0,blue;segment 1.4,0,1.4,1.4,blue;segment 0,0,1.4,1.4,red],html\
cn,6,0,[segment 0,0,1.4,0,blue;segment 1.4,0,1.4,1.4,blue;segment 0,0,1.4,1.4,red],html\
cn,7,0,[segment 0,0,1.4,0,blue;segment 1.4,0,1.4,1.4,blue;segment 0,0,1.4,1.4,red],html\
cn,8,0,[segment 0,0,1.4,0,blue;segment 1.4,0,1.4,1.4,blue;segment 0,0,1.4,1.4,red],html\
cn,9,0,[segment 0,0,1.4,0,blue;segment 1.4,0,1.4,1.4,blue;segment 0,0,1.4,1.4,red],html\
cn,10,0,[segment 0,0,1.4,0,blue;segment 1.4,0,1.4,1.4,blue;segment 0,0,1.4,1.4,red],html\
dn,7,0,[segment 0.5,0.7,1,1,green;trange 0,1;plot red,t,sin(t)],html\
dn,12,10,[segment 0.5,0.7,1,1,green;trange 0,1;plot red,t,sin(t)],html,400\
dn,3,10,[segment 0.5,0.7,1,1,green;trange 0,1;plot red,t,sin(t)]

slib_require=pari

!exit

:proc

!distribute items $wims_read_parm into slib_cndn, slib_n,slib_startang,slib_disegno,slib_url,slib_size
slib_disegno=!declosing $slib_disegno
!! eventualmente calcolare  ?? option
slib_xrange=-2,2
slib_yrange=-2,2
!default slib_size=200

slib_out=xrange $slib_xrange\
yrange $slib_yrange\
linewidth 3

!! it works with flydraw, has to be tested with canvasdraw

!for slib_i = 0 to $slib_n-1
  slib_angolo=$[round(((360*$slib_i)/$slib_n)+$slib_startang)]
  !if $slib_cndn iswordof dn
    slib_matr=[cos(2*pi*$slib_i/$slib_n), -sin (2*pi*$slib_i/$slib_n); -sin(2*pi*$slib_i/$slib_n),-cos(2*pi*$slib_i/$slib_n)]*[cos(2*pi*$slib_startang/360),sin(2*pi*$slib_startang/360);-sin(2*pi*$slib_startang/360),cos(2*pi*$slib_startang/360)]
    slib_matr=!exec pari $slib_matr
    slib_matr=!replace internal ; by , in $slib_matr
    slib_out=$slib_out\
    linear $slib_matr\
    $slib_disegno\
    killlinear
  !endif
  slib_out=$slib_out\
  rotate $slib_angolo\
  $slib_disegno\
  killrotate
!next
!if url iswordof $slib_url or html iswordof $slib_url
  insdraw_size=$slib_size,$slib_size
  !insdraw $slib_out
  slib_out=$ins_url
  !if html iswordof $slib_url
    slib_out=<img src="$ins_url" alt="">
  !else
    slib_out=$slib_out,$insdraw_size
  !endif
!endif