Home » Archimedes archive » Archimedes World » AW-1995-03-Disc1.adf » Disk1Mar95 » !AWMar95/Goodies/DrawBasic/Transforms/Example_7

!AWMar95/Goodies/DrawBasic/Transforms/Example_7

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Archimedes World » AW-1995-03-Disc1.adf » Disk1Mar95
Filename: !AWMar95/Goodies/DrawBasic/Transforms/Example_7
Read OK:
File size: 01F0 bytes
Load address: 0000
Exec address: 0000
File contents
�CreateFlag
 FOR i=1 TO n
   flag=�Rotate(flag,0,0,2*PI/n)
   NEXT
�Quit

DEF �CreateFlag
�Origin(5,5)
 flag=�Flag(0,1,3) 
 n=10
ENDPROC

DEF �Flag(a,b,height)
REM ----------------------
REM Draws a vertical flag
REM stem at (a,b)
REM ----------------------
LOCAL path,x,y,X,Y
�PathBegin(path)
 �Fill@(path,�Red)
 �@VLine(a,b,height)
  x=a+height/18 : y=b+9*height/8
  X=a+height/8  : Y=b+7*height/8
 �Bezier(x,y,X,Y,a+height/4,b+7*height/8)
 �Draw(a,b+3*height/4)
 �CloseWithLine
 �PathEnd
=path
00000000  a0 43 72 65 61 74 65 46  6c 61 67 0a 20 46 4f 52  |.CreateFlag. FOR|
00000010  20 69 3d 31 20 54 4f 20  6e 0a 20 20 20 66 6c 61  | i=1 TO n.   fla|
00000020  67 3d bb 52 6f 74 61 74  65 28 66 6c 61 67 2c 30  |g=.Rotate(flag,0|
00000030  2c 30 2c 32 2a 50 49 2f  6e 29 0a 20 20 20 4e 45  |,0,2*PI/n).   NE|
00000040  58 54 0a a0 51 75 69 74  0a 0a 44 45 46 20 a0 43  |XT..Quit..DEF .C|
00000050  72 65 61 74 65 46 6c 61  67 0a a0 4f 72 69 67 69  |reateFlag..Origi|
00000060  6e 28 35 2c 35 29 0a 20  66 6c 61 67 3d bb 46 6c  |n(5,5). flag=.Fl|
00000070  61 67 28 30 2c 31 2c 33  29 20 0a 20 6e 3d 31 30  |ag(0,1,3) . n=10|
00000080  0a 45 4e 44 50 52 4f 43  0a 0a 44 45 46 20 bb 46  |.ENDPROC..DEF .F|
00000090  6c 61 67 28 61 2c 62 2c  68 65 69 67 68 74 29 0a  |lag(a,b,height).|
000000a0  52 45 4d 20 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |REM ------------|
000000b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 0a 52 45 4d 20 44  |----------.REM D|
000000c0  72 61 77 73 20 61 20 76  65 72 74 69 63 61 6c 20  |raws a vertical |
000000d0  66 6c 61 67 0a 52 45 4d  20 73 74 65 6d 20 61 74  |flag.REM stem at|
000000e0  20 28 61 2c 62 29 0a 52  45 4d 20 2d 2d 2d 2d 2d  | (a,b).REM -----|
000000f0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000100  2d 0a 4c 4f 43 41 4c 20  70 61 74 68 2c 78 2c 79  |-.LOCAL path,x,y|
00000110  2c 58 2c 59 0a a0 50 61  74 68 42 65 67 69 6e 28  |,X,Y..PathBegin(|
00000120  70 61 74 68 29 0a 20 a0  46 69 6c 6c 40 28 70 61  |path). .Fill@(pa|
00000130  74 68 2c bb 52 65 64 29  0a 20 a0 40 56 4c 69 6e  |th,.Red). .@VLin|
00000140  65 28 61 2c 62 2c 68 65  69 67 68 74 29 0a 20 20  |e(a,b,height).  |
00000150  78 3d 61 2b 68 65 69 67  68 74 2f 31 38 20 3a 20  |x=a+height/18 : |
00000160  79 3d 62 2b 39 2a 68 65  69 67 68 74 2f 38 0a 20  |y=b+9*height/8. |
00000170  20 58 3d 61 2b 68 65 69  67 68 74 2f 38 20 20 3a  | X=a+height/8  :|
00000180  20 59 3d 62 2b 37 2a 68  65 69 67 68 74 2f 38 0a  | Y=b+7*height/8.|
00000190  20 a0 42 65 7a 69 65 72  28 78 2c 79 2c 58 2c 59  | .Bezier(x,y,X,Y|
000001a0  2c 61 2b 68 65 69 67 68  74 2f 34 2c 62 2b 37 2a  |,a+height/4,b+7*|
000001b0  68 65 69 67 68 74 2f 38  29 0a 20 a0 44 72 61 77  |height/8). .Draw|
000001c0  28 61 2c 62 2b 33 2a 68  65 69 67 68 74 2f 34 29  |(a,b+3*height/4)|
000001d0  0a 20 a0 43 6c 6f 73 65  57 69 74 68 4c 69 6e 65  |. .CloseWithLine|
000001e0  0a 20 a0 50 61 74 68 45  6e 64 0a 3d 70 61 74 68  |. .PathEnd.=path|
000001f0