!	Program to test drawing of circular arc
	PROGRAM GPE9
	INCLUDE 'SYS$LIBRARY:GKSDEFS.BND'
	REAL*4 XORG,YORG,RADIUS,THETA1,THETA2,FRM
	INTEGER*4 WKTYPE,MASK
	DATA MASK/'FF'X/

	CALL ORIENT('PORTRAIT')
	CALL GSTART	! NOMINATE DEVICE
	CALL PAGE(8.5,11.0)
	CALL AREA2D(7.0,8.0)
	CALL DUPLX
	CALL HEADIN('GPLOT Example 9$',100,2.0,2)
	CALL HEADIN('Test Circular Arc Primitives$',100,1.5,2)

	XORG = 4.0
	YORG = 4.0
	RADIUS = 2.0
	THETA1 = 0.0
	THETA2 = 45.0
	FRM = 0.0               ! FRM = 0 for filled arcs
	CALL GQACWK(1,IERR,NACTV,LWKACT)
	CALL GQWKC(LWKACT,IERR,ICONID,WKTYPE)
	WKTYPE = WKTYPE .AND. MASK
	IF(WKTYPE .EQ. 61) THEN
	  CALL CHRMSG(0.5,6.5,
	1'A DEC-GKS 4.1 bug makes this plot incorrect for postscript.')
	END IF
	CALL GSFAIS(GSOLID)     ! Set to solid fill

D	WRITE(6,*) 'Drawing solid filled pie slice 1'
	CALL BLSLIC(XORG,YORG,RADIUS,THETA1,THETA2,FRM,GATPIE)
	THETA1 = THETA2
	THETA2 = THETA1 + 45.0
	RADIUS = RADIUS + 0.1
	CALL GSFAIS(GHATCH)     ! Change to hatch fill

D	WRITE(6,*) 'Drawing hatch filled pie slice 2'
	CALL BLSLIC(XORG,YORG,RADIUS,THETA1,THETA2,FRM,GATPIE)
	THETA1 = THETA2
	THETA2 = THETA1 + 45.0
	RADIUS = RADIUS + 0.1
!  Note that hatch pattern increments automatically

D	WRITE(6,*) 'Drawing hatch filled pie slice 3'
	CALL BLSLIC(XORG,YORG,RADIUS,THETA1,THETA2,FRM,GATPIE)
	FRM = 1.0               ! FRM > 0.0 for unfilled arc
	THETA1 = THETA2
	THETA2 = THETA1 + 45.0
	RADIUS = RADIUS + 0.1

D	WRITE(6,*) 'Drawing open arc 4'
	CALL BLSLIC(XORG,YORG,RADIUS,THETA1,THETA2,FRM,GATOPN)
	THETA1 = THETA2
	THETA2 = THETA1 + 45.0
	RADIUS = RADIUS + 0.1
	CALL GSFAIS(GHOLLO)

D	WRITE(6,*) 'Drawing hollo pie slice 5'
	CALL BLSLIC(XORG,YORG,RADIUS,THETA1,THETA2,FRM,GATPIE)
	THETA1 = THETA2
	THETA2 = THETA1 + 60.0
	RADIUS = RADIUS + 0.1

D	WRITE(6,*) 'Drawing closed chord 6'
	CALL BLSLIC(XORG,YORG,RADIUS,THETA1,THETA2,FRM,GATCHRD)
	THETA1 = THETA2
	THETA2 = THETA1 + 75.0
	RADIUS = RADIUS + 0.1
	FRM = 0.0

C	IF(WKTYPE .EQ. GPTSC) THEN	! Avoid Postscript driver bug
C	   CALL GSFAIS(GSOLID)     ! Set to solid fill
CD	   WRITE(6,*) 'Drawing solid filled chord 7'
C	ELSE
CD	   WRITE(6,*) 'Drawing hatch filled chord 7'
C	END IF
	CALL BLSLIC(XORG,YORG,RADIUS,THETA1,THETA2,FRM,GATCHRD)
	THETA1 = -30.
	THETA2 = 75.
	RADIUS = 3.0
	FRM = 8.0                   ! Line width times 8

D8	WRITE(6,*) 'Drawing thick-frame arc 8'
	CALL BLSLIC(XORG,YORG,RADIUS,THETA1,THETA2,FRM)

	CALL ENDPL(1)
	CALL GSTOP

	CALL EXIT
	END
