home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
058.lha
/
WallPaper
< prev
next >
Wrap
Text File
|
1986-11-20
|
3KB
|
98 lines
' THIS PROGRAM PLOTS "CHAOTIC ORBITS".
' THE INSPIRATION IS A PAPER BY GUMOWSKI AND MIRA: "POINT
' SEQUENCES GENERATED BY TWO DIMENSIONAL RECURRENCES " FROM
' THE IFIP CONGRESS PROCEEDINGS IN 1974. A VARIANT OF THIS PROGRAM
' BY JOHN LANSDOWN CAN BE FOUND IN A 1979 CREATIVE COMPUTING
' ARTICLE ENTITLED "GUMOWSKI"
' SIMILAR TYPES OF GRAPHS ARE ALSO SHOWN IN THE SEPT. 1986
' COMPUTER RECREATIONS COLUMN OF SCIENTIFIC AMERICAN
' RECODED FOR THE AMIGA, MARCH 1986 BY G. LOEGEL AND MADE AVAILABLE
' FOR NON-COMMERCIAL DISTRIBUTION
'
' THE FNA(X) AND FNB(Y) DEFINE THE RECURRENCE WITH CONSTANTS
' A, B, C, D THESE CAN BE VARIED FOR DIFFERENT PATTERNS. THE
' PROGRAM CURRENTLY ONLY VARIES C.
' N IS THE NUMBER OF POINTS TO PUT IN AN ORBIT AND LC IS THE
' NUMBER OF ORBITS TO PLOT. A SEED VALUE IS RANDOMLY SELECTED
' BETWEEN 0 AND MV AND USED TO START THE ORBIT
' AN ORBIT IS FINISHED EITHER WHEN N POINTS HAVE BEEN PLOTTED
' OR A PREVIOUSLY PLOTTED POINT IS ENCOUNTERED
' THE DATA STATEMETS AT THE END ARE THE VALUES USED IN THE
' GUMOWSKI PAPER FOR A,B,C,D RESPECTIVELY
' ENJOY -GJL
'
DEF FNA(X)=C*X+2*X*X*(1-C)/(1+X*X)
DEF FNB(Y)=D*(1+A+B*Y*Y)*Y
N=200
MV=30
LC=100
XD=640
YD=200
PRINT "ENTER X COORDINATE"
INPUT "ENTER 0 FOR DEFAULT";XL
IF XL=0 THEN XL=-25
PRINT "ENTER Y COORDINATE"
INPUT "ENTER 0 FOR DEFAULT";YL
IF YL=0 THEN YL=XL
XS=-XL
YS=-YL
SCREEN 1,XD,YD,4,2
WINDOW 1,"2D RECURRENCES",,,1
PALETTE 2,.4,.6,1
PALETTE 1,1,1,1
PALETTE 0,0,0,0
PALETTE 3, 1,.73,0
PALETTE 4, .8,.6,.53
PALETTE 5,0,.93,.87
PALETTE 6,.47,.87,1
PALETTE 7, .73,.73,.73
PALETTE 8, .33,.87,0
PALETTE 9, .73,1,0
PALETTE 10,.8,0,.93
PALETTE 11,1,.6,.67
PALETTE 12,.93,.2,0
PALETTE 13,1,.87,.73
PALETTE 14,1,.13,.9
PALETTE 15,1,1,.13
A = 0
B = 0
D = 1
160 FOR C=-.9 TO .9 STEP .1
K=1
CLS
190 XI=MV*RND
XR=RND
IF XR<.5 THEN XI=-XI
YI=RND
YR=RND
IF YR<.5 THEN YI=-YI
X0=XI
Y0=YI
I=0
280
XN=FNB(Y0) + FNA(X0)
YN=FNA(XN)-X0
X0=XN
Y0=YN
XP=INT(XD*ABS((XN-XL)/(XS-XL)))
YP=INT(YD*ABS((YN-YL)/(YS-YL)))
P=(K MOD 14)+1
IF XP>XD OR YP>YD THEN 420
IF POINT(XP,YP)=P THEN 420
IF POINT(XP,YP)<>0 THEN 420
PSET(XP,YP),P
I=I+1
IF I <=N THEN 280
420 K=K+1
IF K<LC THEN 190
NEXT C
DATA 0,0,-.3,1
DATA 0,0,.3,1
DATA 0,0,-.25,1
DATA 0,0,.25,1
DATA 0,0,-.2,1
DATA 0,0,.2,1
DATA 0,0,-.8,1
DATA 0,0,.8,1