    	SUBROUTINE IFARCS( IR, ARRAY )
C
C  PROGRAMMER: R.S. ZHOU	MARCH-1986
C
C	THIS ROUTINE DRAWS AN ARC/CIRCLE/ELLIPSE/PIE/DONUN.
C
C	IR --------- LENGTH OF "ARRAY".
C	ARRAY(1) --- RADIUS IN X-DIMENSION IN INCHES.
C	ARRAY(2) --- RADIUS IN Y-DIMENSION IN INCHES.
C	ARRAY(3) --- BORDER WIDTH (INWARD) IN INCHES.
C		     IF BORDER=RADIUS, A PIE IS DRAWN.
C	ARRAY(4) --- X-COORDINATE OF THE CENTER IN INCHES.
C	ARRAY(5) --- Y-COORDINATE OF THE CENTER IN INCHES.
C	ARRAY(6) --- ROTATION ANGLE OF OBJECT IN DEGREES FROM X-AXIS.
C	ARRAY(7) --- STARTING ANGLE IN DEGREES TO DRAW THE ARC.
C	ARRAY(8) --- ADDITIVE ANGLE IN DEGREES TO ARRAY(7).
C	ARRAY(9) --- CHORD ANGLE IN DEGREES [10.0].
C
    	PARAMETER	D2R= 0.17453292E-1
     	LOGICAL		PIE
     	DIMENSION	ARRAY(1)
C
C  INITIALIZE...
C
     	IRR = IR
     	RD1 = 0.5
     	RD2 = 0.5
     	RD3 = 0.0
     	XPS = 0.0
     	YPS = 0.0
     	ANG0 = 0.0
     	ANG1 = 0.0
     	ANG2 = 360.
     	CHORD = 10.0
     	IF( IRR.GT.0 .AND. ARRAY(1).NE.0.0 ) RD1 = ABS(ARRAY(1))
     	IF( IRR.GT.1 .AND. ARRAY(2).NE.0.0 ) RD2 = ABS(ARRAY(2))
     	IF( IRR.GT.4 ) THEN
     	    XPS = ARRAY(4)
     	    YPS = ARRAY(5)
     	ENDIF
     	IF( IRR.GT.5 ) ANG0 = AMOD( ARRAY(6), 360.0 )
     	IF( IRR.GT.6 ) ANG1 = AMOD( ARRAY(7), 360.0 )
     	IF( IRR.GT.7 ) ANG2 = AMOD( ARRAY(8), 360.0 ) + ANG1
     	IF( ANG1.EQ.ANG2 ) THEN
     	    ANG1 = 0.0
     	    ANG2 = 360.
     	ENDIF
     	IF( ANG1.GT.ANG2 ) THEN
     	    ANGLE = ANG1
     	    ANG1  = ANG2
     	    ANG2  = ANGLE
     	ENDIF
     	IF( IRR.GT.8 .AND. ARRAY(9).GT.0.0 ) THEN
     	    CHORD = ARRAY(9)
     	    IF( CHORD.GT.(ANG2-ANG1) ) CHORD = 0.5*(ANG2-ANG1)
     	ENDIF
     	PIE = .FALSE.
     	IF( IRR.GT.2 .AND. ARRAY(3).NE.0.0 ) THEN
     	    RD3 = ABS(ARRAY(3))
     	    IF( RD3.GE.RD1 .OR. RD3.GE.RD2 ) THEN
     		RD3 = 0.0
     		IF( (ANG2-ANG1).LT.360.0 ) PIE = .TRUE.
     	    ENDIF
     	ENDIF
C
C  MOVE ORIGIN TO (XPS,YPS) ...
C
     	IF( IRR.GT.4 ) CALL IFPLOT( XPS, YPS, -9 )
     	CALL IFPLOT( 0.0, 0.0, 3 )
C
C  SET ROTATION IT AT ALL...
C
    	IF( IRR.GT.5 .AND. ANG0.NE.0.0 ) THEN
     	    CALL IFROTA_NOW( XANG, YANG )
     	    CALL IFROTA( ANG0+XANG, ANG0+YANG )
     	ENDIF
C
C  START THE DRAWING...
C
     	LOOP = 1
     	IF( RD3.GT.0 ) LOOP = 2
     	DO I = 1, LOOP
     	    IF( I.EQ.1 ) THEN
     		ANG11 = ANG1
     		ANG22 = ANG2
     		ANGIN = CHORD
     	    ELSE
     		ANG11 = ANG2
     		ANG22 = ANG1
     		ANGIN = -CHORD
     		RD1 = RD1 - RD3
     		RD2 = RD2 - RD3
     	    ENDIF
     	    RDD = 1.0/(RD1*RD1)
     	DO  ANGLE = ANG11, ANG22, ANGIN
     	    XPS = RD1*COS(ANGLE*D2R)
     	    YPS = 1.0 - XPS*XPS*RDD
     	    IF( YPS.GT.0 ) THEN
     		YPS = RD2*SQRT(YPS)
     	    ELSE
     		YPS = 0.0
     	    ENDIF
     	    IF( ANGLE.GT.180.0 .OR. ANGLE.LT.0.0 ) YPS = -YPS
     	    IF( ANGLE.NE.ANG11 ) THEN
     		CALL IFPLOT( XPS, YPS, 2 )
     	    ELSE
     		IF( I.EQ.1 ) THEN
     		    IF( PIE ) THEN
     			CALL IFPLOT( 0.0, 0.0, 3 )
     			CALL IFPLOT( XPS, YPS, 2 )
     		    ELSE
     		    	CALL IFPLOT( XPS, YPS, 3 )
     		    ENDIF
     		    XPSL = XPS
     		    YPSL = YPS
     		ELSE
     		    IF( (ANG2-ANG1).LT.360.0 ) THEN
     			CALL IFPLOT( XPS, YPS, 2 )
     		    ELSE
     			CALL IFPLOT( XPS, YPS, 3 )
     		    ENDIF
     		ENDIF
     	    ENDIF
     	ENDDO
     	ENDDO
     	IF(LOOP.EQ.2.AND.(ANG2-ANG1).LT.360.) CALL IFPLOT(XPSL,YPSL,2)
C
C  RESTORE...
C
     	IF( PIE ) THEN
     	    CALL IFPLOT( 0.0, 0.0, 2 )
     	ELSE
     	    CALL IFPLOT( 0.0, 0.0, 3 )
     	ENDIF
     	IF( IRR.GT.5 .AND. ANG0.NE.0.0 ) CALL IFROTA( XANG, YANG )
     	IF( IRR.GT.4 ) CALL IFPLOT( -ARRAY(4), -ARRAY(5), -9 )

999	RETURN
    	END

