#
# kihon1.rb
#   $Id: kihon1.rb,v 1.2 2000/11/18 19:03:32 keiko Exp $
#

require "narray"
require "numru/dcl"

include NumRu
include NMath

nmax = 50

x  = NArray.sfloat(nmax+1)
y1 = NArray.sfloat(nmax+1)
y2 = NArray.sfloat(nmax+1)
y3 = NArray.sfloat(nmax+1)

#-- data ----
x = x.indgen * 1.0/nmax
y1 = x**3
y2 = x**2
y3 = sqrt(x)

#-- graph ----
iws = (ARGV[0] || (puts ' WORKSTATION ID (I)  ? ;'; DCL::sgpwsn; gets)).to_i
DCL::sgopn iws
DCL::sgfrm

DCL::slpvpr(1)

DCL::sgplv(x, y1)
DCL::sgpmv(x, y2)
DCL::sgtxv(0.5, 0.5, 'SGTXV')
DCL::sglset('LSOFTF', true)
DCL::sgtnv(x, y3)

DCL::sgcls

