SUBROUTINE CHAOS3(MX,MY,SX,SY,DX,DY,N) C 20.11.85 WI/1 C MANDELBROT-GRAPHIC MAIN ALGORITHM. C C FUNCTIONAL DESCRIPTION : C C The color of a point in the complex plane is evaluated by a C special algorithm : C This program starts computing at a position SV -> SX/SY in the C complex plane.It scanns the plane in X- and Y-Direction by C incrementing the current position with a Delta-Value DV -> C DX:MX / DY:MY resulting in a new current position CP = SV + DV. C This new position is the input for the mentioned special C algorithm SA = (SA - CP)**2.This special algorithm generates C parts of the so called Mandelbrot-Set,named after Benoit B. C Mandelbrot an IBM-Scientist at the Watson-Institute. C This algorithm is applied in a iteration loop on every point in C the selected window.Iteration stops when a limit (B00) is reached C or when the selected number of iterations (N) was exceeded.The C actual number of iterations (K) is a measure for the color of a C specific point in the complex plane. C C Calling Sequence : C C CALL CHAOS3(MX,MY,SX,SY,DX,DY,N) C C Where : C C IN -> MX =: Horizontal resolution in points. C IN -> MY =: Vertical resolution in points. C IN -> SX =: X-Startvalue in the Complex Plane. C IN -> SY =: Y-Startvalue in the Complex Plane. C IN -> DX =: X-Dimension of window C IN -> DY =: Y-Dimension of window C IN -> N =: Number of planned iterations C C The graphic part is implemented in CORE.The subroutine expects a C proper initialization of the used CORE-System. C INCLUDE 'LB:[1,5]CGL.FTN' C COMPLEX CP,SA,B0,B00 REAL*4 SX,SY,DX,DY,X,Y INTEGER*2 K,N,IX,IY,MX,MY,INDEX,COLMAP(24) C C DEFINE COLOR MAP : C DATA COLMAP/ 3,2,2, !ENTRY-0 = BACKGROUND. * 7,0,0, !ENTRY-1 = RED. * 0,7,0, !ENTRY-1 = GREEN. * 0,0,6, !ENTRY-3 = BLUE. * 0,7,6, !ENRTY-4 = TURQUOISE. * 7,0,6, !ENTRY-5 = VIOLET. * 7,7,0, !ENTRY-6 = YELLOW. * 7,1,3/ !ENTRY-7 = PINK. C CALL CGL(GSCM,COLMAP) !SET_COLOR_MAP. C B0=(0.0,0.0) !RESET VALUE. B00=(1000000.0,1000000.0) !CHECK VALUE. C C CHAOS COMPUTATION PART : C DO 10 IY=1,MY !SCAN Y-POINTS. Y=SY+(IY-1)*(DY/MY) C DO 10 IX=1,MX !SCAN X-POINTS. X=SX+(IX-1)*(DX/MX) C CP=CMPLX(X,Y) !COMPLEX DISPLACEMENT. SA=B0 !CLEAR ITERATION VALUE. K=0 !CLEAR ITER-COUNT. C C ITERATION PART : C 5 SA=(SA-CP)**2 !SPECIAL ALGORITHM. K=K+1 !INCREMENT ITER-COUNT. IF(K.GT.N)THEN !CHECK FOR LAZINESS. CONTINUE ELSE IF(CABS(SA).GT.CABS(B00))THEN !CHECK FOR B0UND. CONTINUE ELSE GOTO 5 !AGAIN ! END IF END IF C C DRAW PICTURE : C INDEX=MOD(K,8) !COMPUTE COLOR MAP ENTRY. CALL CGL(GSWI,INDEX) !SET_WRITING-INDEX. C IF(IX.EQ.1)THEN !SUPPRESS RETURN LINE. CALL CGL(GMA2,X,Y) !MOVE_ABS_2. ELSE CALL CGL(GLA2,X,Y) !LINE_ABS_2. END IF C 10 CONTINUE C RETURN C END