!BIFURCATION MAP OF THE QUADRATIC MAP x = a x (1-x)

SET MODE "graphics"

SET WINDOW-.1,4.1,-0.1,1.1

PLOT 0,-.05;4,-.05;4,1;0,1;0,-.05

PRINT "Calculating...Please wait a few seconds..."

PRINT

FOR a = 0 to 4 step 0.01

LET x=0.5

FOR i=0 to 100

LET x=a*x*(1-x)

SET COLOR "RED"

IF i>50 THEN PLOT a,x

NEXT i

NEXT a

DO

GET MOUSE x,y,s

IF s=0 THEN

SET COLOR "BLUE"

SET CURSOR 3,50

PRINT x,y

END IF

IF s=2 THEN

SET COLOR "BLACK"

PLOT x,-.05;x,1

SET TEXT JUSTIFY "center","base"

PLOT TEXT, AT x,-0.1:USING$("#.###",x)

END IF

LOOP

END