Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199312.adf » !StarInfo_StarInfo » Hudson/Riemann

Hudson/Riemann

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 » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199312.adf » !StarInfo_StarInfo
Filename: Hudson/Riemann
Read OK:
File size: 054B bytes
Load address: 0000
Exec address: 0000
File contents
   10REM     >Riemann
   20REM By  Philip Hudson
   30REM For 32-bit machines
   40REM (c) BAU December 1993
   50:
   60ON ERROR GOTO 890
   70TIME=0
   80PROCsetup
   90PROCriemann(PI/6,-PI/4,480,z%)
  100PRINT"time=";TIME
  110END
  120:
  130DEF PROCriemann(la,lo,r%,z%)
  140d%=r%*r%
  150g%=r%-1
  160FOR e%=-g% TO g% STEP z%
  170 FOR f%=-g% TO g% STEP z%
  180  IF e%*e%+f%*f%>d% THEN 220
  190  PROCmap_coords(e%,f%)
  200  GCOL FNiterate(x,y)
  210  POINT e%,f%
  220 NEXT
  230NEXT
  240FOR e%=-g% TO g% STEP z%
  250 FOR f%=-g% TO g% STEP z%
  260  c1%=POINT(e%,f%)
  270  c2%=POINT(e%,f%+z%)
  280  c3%=POINT(e%+z%,f%)
  290  c4%=POINT(e%+z%,f%+z%)
  300  c%=c1%=c2% AND c1%=c3% AND c1%=c4%
  310  IF c% PROCrect ELSE PROCrigmarole
  320 NEXT
  330NEXT
  340ENDPROC
  350:
  360DEF PROCmap_coords(e%,f%)
  370LOCAL p,q
  380p=e%/(r%*SQR(1-f%*f%/d%))
  390q=e%/(r%*p)
  400x=TAN((lo+ASN(p))/2)
  410y=TAN((la+ACS(q)*SGN(f%))/2)
  420ENDPROC
  430:
  440DEF FNiterate(x,y)
  450LOCAL n%,p,q
  460n%=0
  470p=x*x
  480q=y*y
  490REPEAT
  500 y=2*x*y+b
  510 x=p-q+a
  520 p=x*x
  530 q=y*y
  540 n%+=1
  550UNTIL p+q>4 OR n%>63
  560IF n%=64 n%=32
  570=n%
  580:
  590DEF PROCsetup
  600MODE 13
  610a=-1.25
  620b=0
  630z%=16
  640OFF
  650GCOL 0
  660RECTANGLE FILL 128,0,1023,1023
  670ORIGIN 640,512
  680ENDPROC
  690:
  700DEF PROCrect
  710GCOL c1%
  720RECTANGLE FILL e%,f%,z%-5,z%-5
  730ENDPROC
  740:
  750DEF PROCrigmarole
  760LOCAL x%,y%,gx%,gy%
  770FOR x%=0 TO z%-1 STEP 4
  780 FOR y%=0 TO z%-1 STEP 4
  790  gx%=e%+x%
  800  gy%=f%+y%
  810  IF gx%*gx%+gy%*gy%>d% THEN 850
  820  PROCmap_coords(gx%,gy%)
  830  GCOL FNiterate(x,y)
  840  POINT gx%,gy%
  850 NEXT
  860NEXT
  870ENDPROC
  880:
  890ON ERROR OFF
  900IF ERR=17 THEN END
  910MODE 6
  920PRINT "It has gone wrong at line ";ERL
  930PRINT 'REPORT$'
  940END

�     >Riemann
� By  Philip Hudson
� For 32-bit machines
(� (c) BAU December 1993
2:
<� � � �DzC
F�=0
P
�setup
Z�riemann(�/6,-�/4,480,z%)
d�"time=";�
n�
x:
�� �riemann(la,lo,r%,z%)
�d%=r%*r%
�g%=r%-1
�� e%=-g% � g% � z%
� � f%=-g% � g% � z%
�  � e%*e%+f%*f%>d% � �d\@
�  �map_coords(e%,f%)
�  � �iterate(x,y)
�  Ȓ e%,f%
� �
��
�� e%=-g% � g% � z%
� � f%=-g% � g% � z%
  c1%=�e%,f%)
  c2%=�e%,f%+z%)
  c3%=�e%+z%,f%)
"  c4%=�e%+z%,f%+z%)
,$  c%=c1%=c2% � c1%=c3% � c1%=c4%
6  � c% �rect � �rigmarole
@ �
J�
T�
^:
h� �map_coords(e%,f%)
r	� p,q
|p=e%/(r%*�(1-f%*f%/d%))
�q=e%/(r%*p)
�x=�((lo+�(p))/2)
�y=�((la+�(q)*�(f%))/2)
��
�:
�� �iterate(x,y)
�� n%,p,q
�n%=0
�	p=x*x
�	q=y*y
��
� y=2*x*y+b
� x=p-q+a

 p=x*x

 q=y*y

 n%+=1
&� p+q>4 � n%>63
0� n%=64 n%=32
:=n%
D:
N� �setup
X� 13
ba=-1.25
lb=0
v	z%=16
��
�� 0
�ȓ Ȑ 128,0,1023,1023
�ȑ 640,512
��
�:
�� �rect
�	� c1%
�ȓ Ȑ e%,f%,z%-5,z%-5
��
�:
�� �rigmarole
�� x%,y%,gx%,gy%
� x%=0 � z%-1 � 4
 � y%=0 � z%-1 � 4
  gx%=e%+x%
   gy%=f%+y%
*!  � gx%*gx%+gy%*gy%>d% � �DRC
4  �map_coords(gx%,gy%)
>  � �iterate(x,y)
H  Ȓ gx%,gy%
R �
\�
f�
p:
z	� � �
�� �=17 � �
�� 6
�$� "It has gone wrong at line ";�
�
� '�$'
��
�
00000000  0d 00 0a 12 f4 20 20 20  20 20 3e 52 69 65 6d 61  |.....     >Riema|
00000010  6e 6e 0d 00 14 17 f4 20  42 79 20 20 50 68 69 6c  |nn..... By  Phil|
00000020  69 70 20 48 75 64 73 6f  6e 0d 00 1e 19 f4 20 46  |ip Hudson..... F|
00000030  6f 72 20 33 32 2d 62 69  74 20 6d 61 63 68 69 6e  |or 32-bit machin|
00000040  65 73 0d 00 28 1b f4 20  28 63 29 20 42 41 55 20  |es..(.. (c) BAU |
00000050  44 65 63 65 6d 62 65 72  20 31 39 39 33 0d 00 32  |December 1993..2|
00000060  05 3a 0d 00 3c 0e ee 20  85 20 e5 20 8d 44 7a 43  |.:..<.. . . .DzC|
00000070  0d 00 46 07 d1 3d 30 0d  00 50 0a f2 73 65 74 75  |..F..=0..P..setu|
00000080  70 0d 00 5a 1d f2 72 69  65 6d 61 6e 6e 28 af 2f  |p..Z..riemann(./|
00000090  36 2c 2d af 2f 34 2c 34  38 30 2c 7a 25 29 0d 00  |6,-./4,480,z%)..|
000000a0  64 0e f1 22 74 69 6d 65  3d 22 3b 91 0d 00 6e 05  |d.."time=";...n.|
000000b0  e0 0d 00 78 05 3a 0d 00  82 1b dd 20 f2 72 69 65  |...x.:..... .rie|
000000c0  6d 61 6e 6e 28 6c 61 2c  6c 6f 2c 72 25 2c 7a 25  |mann(la,lo,r%,z%|
000000d0  29 0d 00 8c 0c 64 25 3d  72 25 2a 72 25 0d 00 96  |)....d%=r%*r%...|
000000e0  0b 67 25 3d 72 25 2d 31  0d 00 a0 16 e3 20 65 25  |.g%=r%-1..... e%|
000000f0  3d 2d 67 25 20 b8 20 67  25 20 88 20 7a 25 0d 00  |=-g% . g% . z%..|
00000100  aa 17 20 e3 20 66 25 3d  2d 67 25 20 b8 20 67 25  |.. . f%=-g% . g%|
00000110  20 88 20 7a 25 0d 00 b4  1d 20 20 e7 20 65 25 2a  | . z%....  . e%*|
00000120  65 25 2b 66 25 2a 66 25  3e 64 25 20 8c 20 8d 64  |e%+f%*f%>d% . .d|
00000130  5c 40 0d 00 be 18 20 20  f2 6d 61 70 5f 63 6f 6f  |\@....  .map_coo|
00000140  72 64 73 28 65 25 2c 66  25 29 0d 00 c8 15 20 20  |rds(e%,f%)....  |
00000150  e6 20 a4 69 74 65 72 61  74 65 28 78 2c 79 29 0d  |. .iterate(x,y).|
00000160  00 d2 0e 20 20 c8 92 20  65 25 2c 66 25 0d 00 dc  |...  .. e%,f%...|
00000170  06 20 ed 0d 00 e6 05 ed  0d 00 f0 16 e3 20 65 25  |. ........... e%|
00000180  3d 2d 67 25 20 b8 20 67  25 20 88 20 7a 25 0d 00  |=-g% . g% . z%..|
00000190  fa 17 20 e3 20 66 25 3d  2d 67 25 20 b8 20 67 25  |.. . f%=-g% . g%|
000001a0  20 88 20 7a 25 0d 01 04  11 20 20 63 31 25 3d b0  | . z%....  c1%=.|
000001b0  65 25 2c 66 25 29 0d 01  0e 14 20 20 63 32 25 3d  |e%,f%)....  c2%=|
000001c0  b0 65 25 2c 66 25 2b 7a  25 29 0d 01 18 14 20 20  |.e%,f%+z%)....  |
000001d0  63 33 25 3d b0 65 25 2b  7a 25 2c 66 25 29 0d 01  |c3%=.e%+z%,f%)..|
000001e0  22 17 20 20 63 34 25 3d  b0 65 25 2b 7a 25 2c 66  |".  c4%=.e%+z%,f|
000001f0  25 2b 7a 25 29 0d 01 2c  24 20 20 63 25 3d 63 31  |%+z%)..,$  c%=c1|
00000200  25 3d 63 32 25 20 80 20  63 31 25 3d 63 33 25 20  |%=c2% . c1%=c3% |
00000210  80 20 63 31 25 3d 63 34  25 0d 01 36 1d 20 20 e7  |. c1%=c4%..6.  .|
00000220  20 63 25 20 f2 72 65 63  74 20 8b 20 f2 72 69 67  | c% .rect . .rig|
00000230  6d 61 72 6f 6c 65 0d 01  40 06 20 ed 0d 01 4a 05  |marole..@. ...J.|
00000240  ed 0d 01 54 05 e1 0d 01  5e 05 3a 0d 01 68 18 dd  |...T....^.:..h..|
00000250  20 f2 6d 61 70 5f 63 6f  6f 72 64 73 28 65 25 2c  | .map_coords(e%,|
00000260  66 25 29 0d 01 72 09 ea  20 70 2c 71 0d 01 7c 1b  |f%)..r.. p,q..|.|
00000270  70 3d 65 25 2f 28 72 25  2a b6 28 31 2d 66 25 2a  |p=e%/(r%*.(1-f%*|
00000280  66 25 2f 64 25 29 29 0d  01 86 0f 71 3d 65 25 2f  |f%/d%))....q=e%/|
00000290  28 72 25 2a 70 29 0d 01  90 14 78 3d b7 28 28 6c  |(r%*p)....x=.((l|
000002a0  6f 2b 98 28 70 29 29 2f  32 29 0d 01 9a 1a 79 3d  |o+.(p))/2)....y=|
000002b0  b7 28 28 6c 61 2b 95 28  71 29 2a b4 28 66 25 29  |.((la+.(q)*.(f%)|
000002c0  29 2f 32 29 0d 01 a4 05  e1 0d 01 ae 05 3a 0d 01  |)/2).........:..|
000002d0  b8 13 dd 20 a4 69 74 65  72 61 74 65 28 78 2c 79  |... .iterate(x,y|
000002e0  29 0d 01 c2 0c ea 20 6e  25 2c 70 2c 71 0d 01 cc  |)..... n%,p,q...|
000002f0  08 6e 25 3d 30 0d 01 d6  09 70 3d 78 2a 78 0d 01  |.n%=0....p=x*x..|
00000300  e0 09 71 3d 79 2a 79 0d  01 ea 05 f5 0d 01 f4 0e  |..q=y*y.........|
00000310  20 79 3d 32 2a 78 2a 79  2b 62 0d 01 fe 0c 20 78  | y=2*x*y+b.... x|
00000320  3d 70 2d 71 2b 61 0d 02  08 0a 20 70 3d 78 2a 78  |=p-q+a.... p=x*x|
00000330  0d 02 12 0a 20 71 3d 79  2a 79 0d 02 1c 0a 20 6e  |.... q=y*y.... n|
00000340  25 2b 3d 31 0d 02 26 13  fd 20 70 2b 71 3e 34 20  |%+=1..&.. p+q>4 |
00000350  84 20 6e 25 3e 36 33 0d  02 30 11 e7 20 6e 25 3d  |. n%>63..0.. n%=|
00000360  36 34 20 6e 25 3d 33 32  0d 02 3a 07 3d 6e 25 0d  |64 n%=32..:.=n%.|
00000370  02 44 05 3a 0d 02 4e 0c  dd 20 f2 73 65 74 75 70  |.D.:..N.. .setup|
00000380  0d 02 58 08 eb 20 31 33  0d 02 62 0b 61 3d 2d 31  |..X.. 13..b.a=-1|
00000390  2e 32 35 0d 02 6c 07 62  3d 30 0d 02 76 09 7a 25  |.25..l.b=0..v.z%|
000003a0  3d 31 36 0d 02 80 05 87  0d 02 8a 07 e6 20 30 0d  |=16.......... 0.|
000003b0  02 94 19 c8 93 20 c8 90  20 31 32 38 2c 30 2c 31  |..... .. 128,0,1|
000003c0  30 32 33 2c 31 30 32 33  0d 02 9e 0e c8 91 20 36  |023,1023...... 6|
000003d0  34 30 2c 35 31 32 0d 02  a8 05 e1 0d 02 b2 05 3a  |40,512.........:|
000003e0  0d 02 bc 0b dd 20 f2 72  65 63 74 0d 02 c6 09 e6  |..... .rect.....|
000003f0  20 63 31 25 0d 02 d0 19  c8 93 20 c8 90 20 65 25  | c1%...... .. e%|
00000400  2c 66 25 2c 7a 25 2d 35  2c 7a 25 2d 35 0d 02 da  |,f%,z%-5,z%-5...|
00000410  05 e1 0d 02 e4 05 3a 0d  02 ee 10 dd 20 f2 72 69  |......:..... .ri|
00000420  67 6d 61 72 6f 6c 65 0d  02 f8 13 ea 20 78 25 2c  |gmarole..... x%,|
00000430  79 25 2c 67 78 25 2c 67  79 25 0d 03 02 15 e3 20  |y%,gx%,gy%..... |
00000440  78 25 3d 30 20 b8 20 7a  25 2d 31 20 88 20 34 0d  |x%=0 . z%-1 . 4.|
00000450  03 0c 16 20 e3 20 79 25  3d 30 20 b8 20 7a 25 2d  |... . y%=0 . z%-|
00000460  31 20 88 20 34 0d 03 16  0f 20 20 67 78 25 3d 65  |1 . 4....  gx%=e|
00000470  25 2b 78 25 0d 03 20 0f  20 20 67 79 25 3d 66 25  |%+x%.. .  gy%=f%|
00000480  2b 79 25 0d 03 2a 21 20  20 e7 20 67 78 25 2a 67  |+y%..*!  . gx%*g|
00000490  78 25 2b 67 79 25 2a 67  79 25 3e 64 25 20 8c 20  |x%+gy%*gy%>d% . |
000004a0  8d 44 52 43 0d 03 34 1a  20 20 f2 6d 61 70 5f 63  |.DRC..4.  .map_c|
000004b0  6f 6f 72 64 73 28 67 78  25 2c 67 79 25 29 0d 03  |oords(gx%,gy%)..|
000004c0  3e 15 20 20 e6 20 a4 69  74 65 72 61 74 65 28 78  |>.  . .iterate(x|
000004d0  2c 79 29 0d 03 48 10 20  20 c8 92 20 67 78 25 2c  |,y)..H.  .. gx%,|
000004e0  67 79 25 0d 03 52 06 20  ed 0d 03 5c 05 ed 0d 03  |gy%..R. ...\....|
000004f0  66 05 e1 0d 03 70 05 3a  0d 03 7a 09 ee 20 85 20  |f....p.:..z.. . |
00000500  87 0d 03 84 0e e7 20 9f  3d 31 37 20 8c 20 e0 0d  |...... .=17 . ..|
00000510  03 8e 07 eb 20 36 0d 03  98 24 f1 20 22 49 74 20  |.... 6...$. "It |
00000520  68 61 73 20 67 6f 6e 65  20 77 72 6f 6e 67 20 61  |has gone wrong a|
00000530  74 20 6c 69 6e 65 20 22  3b 9e 0d 03 a2 0a f1 20  |t line ";...... |
00000540  27 f6 24 27 0d 03 ac 05  e0 0d ff                 |'.$'.......|
0000054b