Home » Archimedes archive » Acorn User » AU 1993-10.adf » !StarInfo_StarInfo » FatLines

FatLines

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 » Acorn User » AU 1993-10.adf » !StarInfo_StarInfo
Filename: FatLines
Read OK:
File size: 0275 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM     >FatLines
   20REM By  Jan Vibe
   30REM For 32-bit machines (Risc OS 3.1)
   40REM (c) BAU October 1993
   50:
   60MODE 15
   70OFF
   80REPEAT
   90 width%=RND(120)+8
  100 GCOL RND(63)+1
  110 x1%=RND(1280-width%)+width%/2
  120 y1%=RND(1024-width%)+width%/2
  130 x2%=RND(1280-width%)+width%/2
  140 y2%=RND(1024-width%)+width%/2
  150 PROCline(x1%,y1%,x2%,y2%,width%)
  160UNTIL FALSE
  170:
  180DEF PROCline(x1,y1,x2,y2,w)
  190LOCAL l,t1,t2
  200l=SQR((x1-x2)^2+(y1-y2)^2)
  210IF x1>x2 l=-l
  220IF l<>0 THEN
  230 t1=ASN((y1-y2)/l)
  240 t2=t1+PI
  250 w=w/2
  260 MOVE x1+w*SIN(t1),y1+w*COS(t1)
  270 MOVE x1+w*SIN(t2),y1+w*COS(t2)
  280 PLOT &75,x2+w*SIN(t2),y2+w*COS(t2)
  290 CIRCLE FILL x1,y1,w
  300 CIRCLE FILL x2,y2,w
  310ELSE
  320 CIRCLE FILL x1,y1,w
  330ENDIF
  340ENDPROC

�     >FatLines
� By  Jan Vibe
'� For 32-bit machines (Risc OS 3.1)
(� (c) BAU October 1993
2:
<� 15
F�
P�
Z width%=�(120)+8
d � �(63)+1
n  x1%=�(1280-width%)+width%/2
x  y1%=�(1024-width%)+width%/2
�  x2%=�(1280-width%)+width%/2
�  y2%=�(1024-width%)+width%/2
�" �line(x1%,y1%,x2%,y2%,width%)
�� �
�:
�� �line(x1,y1,x2,y2,w)
�
� l,t1,t2
�l=�((x1-x2)^2+(y1-y2)^2)
�� x1>x2 l=-l
�� l<>0 �
� t1=�((y1-y2)/l)
� t2=t1+�
�
 w=w/2
 � x1+w*�(t1),y1+w*�(t1)
 � x1+w*�(t2),y1+w*�(t2)
  � &75,x2+w*�(t2),y2+w*�(t2)
" ȏ Ȑ x1,y1,w
, ȏ Ȑ x2,y2,w
6�
@ ȏ Ȑ x1,y1,w
J�
T�
�
00000000  0d 00 0a 13 f4 20 20 20  20 20 3e 46 61 74 4c 69  |.....     >FatLi|
00000010  6e 65 73 0d 00 14 12 f4  20 42 79 20 20 4a 61 6e  |nes..... By  Jan|
00000020  20 56 69 62 65 0d 00 1e  27 f4 20 46 6f 72 20 33  | Vibe...'. For 3|
00000030  32 2d 62 69 74 20 6d 61  63 68 69 6e 65 73 20 28  |2-bit machines (|
00000040  52 69 73 63 20 4f 53 20  33 2e 31 29 0d 00 28 1a  |Risc OS 3.1)..(.|
00000050  f4 20 28 63 29 20 42 41  55 20 4f 63 74 6f 62 65  |. (c) BAU Octobe|
00000060  72 20 31 39 39 33 0d 00  32 05 3a 0d 00 3c 08 eb  |r 1993..2.:..<..|
00000070  20 31 35 0d 00 46 05 87  0d 00 50 05 f5 0d 00 5a  | 15..F....P....Z|
00000080  14 20 77 69 64 74 68 25  3d b3 28 31 32 30 29 2b  |. width%=.(120)+|
00000090  38 0d 00 64 0e 20 e6 20  b3 28 36 33 29 2b 31 0d  |8..d. . .(63)+1.|
000000a0  00 6e 20 20 78 31 25 3d  b3 28 31 32 38 30 2d 77  |.n  x1%=.(1280-w|
000000b0  69 64 74 68 25 29 2b 77  69 64 74 68 25 2f 32 0d  |idth%)+width%/2.|
000000c0  00 78 20 20 79 31 25 3d  b3 28 31 30 32 34 2d 77  |.x  y1%=.(1024-w|
000000d0  69 64 74 68 25 29 2b 77  69 64 74 68 25 2f 32 0d  |idth%)+width%/2.|
000000e0  00 82 20 20 78 32 25 3d  b3 28 31 32 38 30 2d 77  |..  x2%=.(1280-w|
000000f0  69 64 74 68 25 29 2b 77  69 64 74 68 25 2f 32 0d  |idth%)+width%/2.|
00000100  00 8c 20 20 79 32 25 3d  b3 28 31 30 32 34 2d 77  |..  y2%=.(1024-w|
00000110  69 64 74 68 25 29 2b 77  69 64 74 68 25 2f 32 0d  |idth%)+width%/2.|
00000120  00 96 22 20 f2 6c 69 6e  65 28 78 31 25 2c 79 31  |.." .line(x1%,y1|
00000130  25 2c 78 32 25 2c 79 32  25 2c 77 69 64 74 68 25  |%,x2%,y2%,width%|
00000140  29 0d 00 a0 07 fd 20 a3  0d 00 aa 05 3a 0d 00 b4  |)..... .....:...|
00000150  1a dd 20 f2 6c 69 6e 65  28 78 31 2c 79 31 2c 78  |.. .line(x1,y1,x|
00000160  32 2c 79 32 2c 77 29 0d  00 be 0d ea 20 6c 2c 74  |2,y2,w)..... l,t|
00000170  31 2c 74 32 0d 00 c8 1c  6c 3d b6 28 28 78 31 2d  |1,t2....l=.((x1-|
00000180  78 32 29 5e 32 2b 28 79  31 2d 79 32 29 5e 32 29  |x2)^2+(y1-y2)^2)|
00000190  0d 00 d2 10 e7 20 78 31  3e 78 32 20 6c 3d 2d 6c  |..... x1>x2 l=-l|
000001a0  0d 00 dc 0c e7 20 6c 3c  3e 30 20 8c 0d 00 e6 14  |..... l<>0 .....|
000001b0  20 74 31 3d 98 28 28 79  31 2d 79 32 29 2f 6c 29  | t1=.((y1-y2)/l)|
000001c0  0d 00 f0 0c 20 74 32 3d  74 31 2b af 0d 00 fa 0a  |.... t2=t1+.....|
000001d0  20 77 3d 77 2f 32 0d 01  04 1c 20 ec 20 78 31 2b  | w=w/2.... . x1+|
000001e0  77 2a b5 28 74 31 29 2c  79 31 2b 77 2a 9b 28 74  |w*.(t1),y1+w*.(t|
000001f0  31 29 0d 01 0e 1c 20 ec  20 78 31 2b 77 2a b5 28  |1).... . x1+w*.(|
00000200  74 32 29 2c 79 31 2b 77  2a 9b 28 74 32 29 0d 01  |t2),y1+w*.(t2)..|
00000210  18 20 20 f0 20 26 37 35  2c 78 32 2b 77 2a b5 28  |.  . &75,x2+w*.(|
00000220  74 32 29 2c 79 32 2b 77  2a 9b 28 74 32 29 0d 01  |t2),y2+w*.(t2)..|
00000230  22 12 20 c8 8f 20 c8 90  20 78 31 2c 79 31 2c 77  |". .. .. x1,y1,w|
00000240  0d 01 2c 12 20 c8 8f 20  c8 90 20 78 32 2c 79 32  |..,. .. .. x2,y2|
00000250  2c 77 0d 01 36 05 cc 0d  01 40 12 20 c8 8f 20 c8  |,w..6....@. .. .|
00000260  90 20 78 31 2c 79 31 2c  77 0d 01 4a 05 cd 0d 01  |. x1,y1,w..J....|
00000270  54 05 e1 0d ff                                    |T....|
00000275