%GCL
// Demonstration of CURVE

N=101
PI    = 3.1415926

XRAY  = FALLOC (N)  // Allocates array and initializes with 0,1,..,n-1    
XRAY  = XRAY * 3.6
YRAY1 = SIN (XRAY * PI / 180.)
YRAY2 = COS (XRAY * PI / 180.)

METAFL ('CONS')
DISINI ()
HWFONT ()
PAGERA ()

AXSPOS (450, 1800)
AXSLEN (2200, 1200)

NAME   ('X-axis', 'X') 
NAME   ('Y-axis', 'Y') 
TITLIN ('Demostration of CURVE', 1)
TITLIN ('Legend', 3)
TICKS  (10, 'X')
LABDIG (-1, 'X')

GRAF   (0.,360.,0.,90.,-1.,1.,-1.,0.5)
TITLE  ()

COLOR  ('red')
CURVE  (xray, yray1, n)

COLOR  ('green')
CURVE  (xray, yray2, n)

COLOR  ('FORE')
LEGINI (CBUF, 2, 7)
LEGLIN (CBUF, 'sin (x)', 1)
LEGLIN (CBUF, 'cos (x)', 2)
LEGPOS (1550, 750)
LEGTIT ('Legend')
LEGEND (CBUF, 3)

DISFIN ()
