C FLY PROGRAM			BY J.A.SMITH
C				   DEPT. OF SYSTEMS DESIGN
C THIS PROGRAM ALLOWS ONE TO MOVE (FLY) AROUND ANY DATA SET THAT IS 
C READ IN.
	LOGICAL B1,B2,B3
	DIMENSION LIST(10)
	COMMON/LIMITS/XMIN,XMAX,YMIN,YMAX
	COMMON/OUTPUT/LINE(4,600)
	COMMON/PAINT/I2STRT,I2END,PICT(4,300)
	COMMON/BULK/I3STRT,I3END,O(6,300)
	COMMON/EYCEP/EYE(3),CENTRE(3),UP(3)
C
	CALL SETUP
C
	READ (5,10) N,ARRAY
	WRITE (4,10) N
	READ (5,11) ((O(I,J),I=1,6),J=1,N)
10	FORMAT (I4,A3)
11	FORMAT (6F10.2)
C
	RADIAN=3.14159/180.0
C
	I2STRT=1
	I3STRT=1
	I3END=N
C
	IDS=300
	IDL=1
C
	XMIN=(-80.0)
	XMAX=80.0
	YMIN=XMIN
	YMAX=XMAX
C
	EYE(1)=0.0
	EYE(2)=20.0
	EYE(3)=200.0
C
C
100	READ (7) B1,B2,B3
	IF (B1) HIGH=10.0
	IF (B2) HIGH=-10.0
	IF (B3) HIGH=0.0
	CALL ADINP(.TRUE.,3,36,LIST,.TRUE.)
	XDEL=(LIST(1)-1040)/100
	ZDEL=(LIST(2)-1020)/100
	TURN=(LIST(3)-1020)/150
C
1	EYE(1)=EYE(1)+XDEL
	EYE(2)=EYE(2)+HIGH
	EYE(3)=EYE(3)+ZDEL
C
	XD=CENTRE(1)-EYE(1)
	ZD=CENTRE(3)-EYE(3)
	ANG=-TURN*RADIAN
	COSE=COS(ANG)
	SINE=SIN(ANG)
	CENTRE(1)=(XD*COSE+ZD*SINE)+EYE(1)
	CENTRE(2)=5.0
	CENTRE(3)=(ZD*COSE-XD*SINE)+EYE(3)
C
	UP(1)=CENTRE(1)
	UP(2)=CENTRE(2)+10.0
	UP(3)=CENTRE(3)
C
	CALL ROTER
	CALL MAPPER (250.0)
	I1STRT=IDS
	CALL SCALE (I1STRT,I1END)
	CALL DRAWS (LINE,I1STRT,I1END)
	ISAV=IDS
	IDS=IDL
	IDL=ISAV
C
	GO TO 100
2	CONTINUE
	STOP
	END
