Home » Archimedes archive » Archimedes World » AW-1995-01-Disc1.adf » Disk1Jan95 » !AWJan95/Goodies/DrawBasic/!DrawBasic/Library/Examples/Chapter/Ex_9_16

!AWJan95/Goodies/DrawBasic/!DrawBasic/Library/Examples/Chapter/Ex_9_16

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-01-Disc1.adf » Disk1Jan95
Filename: !AWJan95/Goodies/DrawBasic/!DrawBasic/Library/Examples/Chapter/Ex_9_16
Read OK:
File size: 01D6 bytes
Load address: 0000
Exec address: 0000
Duplicates

There are 3 duplicate copies of this file in the archive:

File contents
REM N.B. If you have the "MathPhys" font then remove the next REM
REM statement. This results in the proper symbol for PI being printed.

REM �Font("MathPhys",12)

�Screen(-2*PI,2*PI,-2,2)
�Graph("SINx",TRUE)
�Area("SINx",-PI/2,PI/2,TRUE)
�Quit

DEF �Area(f$,a,b,n%)
LOCAL path,x,y 
�PathBegin(path)
  x=a : y=EVALf$
 �Move(x,0) : �Draw(x,y)
 �@Graph(f$,a,b,n%)
 �Draw(b,0) : �Draw(a,0)
 �CloseWithLine
 �PathEnd
 �Fill@(path,�DesktopColour(3))
 �DrawPath(path)
 ENDPROC
00000000  52 45 4d 20 4e 2e 42 2e  20 49 66 20 79 6f 75 20  |REM N.B. If you |
00000010  68 61 76 65 20 74 68 65  20 22 4d 61 74 68 50 68  |have the "MathPh|
00000020  79 73 22 20 66 6f 6e 74  20 74 68 65 6e 20 72 65  |ys" font then re|
00000030  6d 6f 76 65 20 74 68 65  20 6e 65 78 74 20 52 45  |move the next RE|
00000040  4d 0a 52 45 4d 20 73 74  61 74 65 6d 65 6e 74 2e  |M.REM statement.|
00000050  20 54 68 69 73 20 72 65  73 75 6c 74 73 20 69 6e  | This results in|
00000060  20 74 68 65 20 70 72 6f  70 65 72 20 73 79 6d 62  | the proper symb|
00000070  6f 6c 20 66 6f 72 20 50  49 20 62 65 69 6e 67 20  |ol for PI being |
00000080  70 72 69 6e 74 65 64 2e  0a 0a 52 45 4d 20 a0 46  |printed...REM .F|
00000090  6f 6e 74 28 22 4d 61 74  68 50 68 79 73 22 2c 31  |ont("MathPhys",1|
000000a0  32 29 0a 0a a0 53 63 72  65 65 6e 28 2d 32 2a 50  |2)...Screen(-2*P|
000000b0  49 2c 32 2a 50 49 2c 2d  32 2c 32 29 0a a0 47 72  |I,2*PI,-2,2)..Gr|
000000c0  61 70 68 28 22 53 49 4e  78 22 2c 54 52 55 45 29  |aph("SINx",TRUE)|
000000d0  0a a0 41 72 65 61 28 22  53 49 4e 78 22 2c 2d 50  |..Area("SINx",-P|
000000e0  49 2f 32 2c 50 49 2f 32  2c 54 52 55 45 29 0a a0  |I/2,PI/2,TRUE)..|
000000f0  51 75 69 74 0a 0a 44 45  46 20 a0 41 72 65 61 28  |Quit..DEF .Area(|
00000100  66 24 2c 61 2c 62 2c 6e  25 29 0a 4c 4f 43 41 4c  |f$,a,b,n%).LOCAL|
00000110  20 70 61 74 68 2c 78 2c  79 20 0a a0 50 61 74 68  | path,x,y ..Path|
00000120  42 65 67 69 6e 28 70 61  74 68 29 0a 20 20 78 3d  |Begin(path).  x=|
00000130  61 20 3a 20 79 3d 45 56  41 4c 66 24 0a 20 a0 4d  |a : y=EVALf$. .M|
00000140  6f 76 65 28 78 2c 30 29  20 3a 20 a0 44 72 61 77  |ove(x,0) : .Draw|
00000150  28 78 2c 79 29 0a 20 a0  40 47 72 61 70 68 28 66  |(x,y). .@Graph(f|
00000160  24 2c 61 2c 62 2c 6e 25  29 0a 20 a0 44 72 61 77  |$,a,b,n%). .Draw|
00000170  28 62 2c 30 29 20 3a 20  a0 44 72 61 77 28 61 2c  |(b,0) : .Draw(a,|
00000180  30 29 0a 20 a0 43 6c 6f  73 65 57 69 74 68 4c 69  |0). .CloseWithLi|
00000190  6e 65 0a 20 a0 50 61 74  68 45 6e 64 0a 20 a0 46  |ne. .PathEnd. .F|
000001a0  69 6c 6c 40 28 70 61 74  68 2c bb 44 65 73 6b 74  |ill@(path,.Deskt|
000001b0  6f 70 43 6f 6c 6f 75 72  28 33 29 29 0a 20 a0 44  |opColour(3)). .D|
000001c0  72 61 77 50 61 74 68 28  70 61 74 68 29 0a 20 45  |rawPath(path). E|
000001d0  4e 44 50 52 4f 43                                 |NDPROC|
000001d6