C****************************************************************
C* 								*
C*								*
C*	DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY *
C*	EITHER FOR THE CREATION OR FOR THE CLINICAL EFFICACY	*
C*	OF THIS PROGRAM. USERS MUST ASSUME FULL RESPONSIBILITY	*
C*	FOR ANY RESULTS OR DIAGNOSES OBTAINED FROM THE USE	*
C*	OF THIS PROGRAM. QUESTIONS ON THE EXECUTION OF THIS	*
C*	PROGRAM MUST BE REFERRED BACK TO THE ORIGINAL AUTHOR.	*
C*								*
C* AUTHOR:	SALLY FORSTER					*
C*		C/O DEPARTMENT OF NUCLEAR MEDICINE		*
C*		GUY'S HOSPITAL				*
C*		LONDON, ENGLAND					*
C*								*
C*		TEL: 01-407-7600 EXT 2583/4			*
C*								*
C****************************************************************
	SUBROUTINE POLACC(IX1,IX2,SUMX,SUMY,ARRAY,A,RESSSQ)
	COMMON//IBLK(256),CY(512),CX(512)
	COMMON/WINDOW/IFST,ILST
	COMMON/FIT/CA(4)
	REAL*8 SUMX,SUMY,XTERM,YTERM,ARRAY,RESSSQ,A
	DIMENSION SUMX(5),SUMY(3),ARRAY(3,3),A(3)
C*****
C*****ACCUMULATE SUMS
C*****
11	DO 13 N=1,5
13	SUMX(N)=0
	DO 15 J=1,3
15	SUMY(J)=0
	RESSSQ=0
21	DO 50 I=IX1,IX2
	XI=CX(I-IFST+1)
	YI=CY(I)
	XTERM=1
	DO 44 N=1,5
	SUMX(N)=SUMX(N)+XTERM
44	XTERM=XTERM*XI
45	YTERM=YI
	DO 48 N=1,3
	SUMY(N)=SUMY(N)+YTERM
48	YTERM=YTERM*XI
49	RESSSQ=RESSSQ+YI**2
50	CONTINUE
	RETURN
	END
