%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 ()
COMPLX ()
PAGERA ()

NAME   ('X-axis', 'X') 
NAME   ('Y-axis', 'Y') 
TITLIN ('Demostration of CURVE', 2)
TICKS  (10, 'X')
DIGITS (-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 (1500,600)
LEGTIT ('Legend')
LEGEND (CBUF, 3)

MPAEPL (3)
DISFIN ()
