#
# uupk07.rb
#
# $Id: uupk07.rb,v 1.1 2000/11/23 08:19:15 keiko Exp $
#

require "narray"
require "numru/dcl"

include NumRu
include Math


MAX = 5

#-- data ---
xnec = NArray[1.2, 2.5, 3.3, 3.7, 3.1]
xapl = NArray[1.3, 2.6, 3.8, 4.4, 4.5]
xibm = NArray[1.7, 2.2, 3.5, 4.2, 5.7]

rundef = DCL::glrget('RUNDEF')

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

DCL::grfrm

DCL::grswnd(0.0, 5.0, rundef, rundef)
DCL::usspnt(rundef, xibm)
DCL::usspnt(rundef, xnec)
DCL::usspnt(rundef, xapl)
DCL::usspnt(rundef, [0.0])
DCL::uspfit
DCL::grstrf

DCL::usdaxs

DCL::uusidv(0.3, 4.3)
DCL::uusarp(2999, 2999)
DCL::uvbra(rundef, xnec, rundef)
DCL::uvbrf(rundef, xnec, rundef)

DCL::uusidv(0.5, 4.5)
DCL::uusarp(3999, 3999)
DCL::uvbra(rundef, xapl, rundef)
DCL::uvbrf(rundef, xapl, rundef)

DCL::uusidv(0.7, 4.7)
DCL::uusarp(4999, 4999)
DCL::uvbra(rundef, xibm, rundef)
DCL::uvbrf(rundef, xibm, rundef)

DCL::grfrm

for i in 0..MAX-1
  xapl[i] = xnec[i] + xapl[i]
  xibm[i] = xapl[i] + xibm[i]
end

DCL::grswnd(0.0, 5.0, rundef, rundef)
DCL::usspnt(rundef, xibm)
DCL::usspnt(rundef, [0.0])
DCL::uspfit
DCL::grstrf

DCL::usdaxs

DCL::uusidv(0.5, 4.5)

DCL::uusarp(2999, 2999)
DCL::uusbrs(0.05)
DCL::uvbra(rundef, xnec, rundef)
DCL::uusarp(3999, 3999)
DCL::uvbra(rundef, xnec, xapl)
DCL::uusarp(4999, 4999)
DCL::uvbra(rundef, xapl, xibm)

DCL::uvbrf(rundef, xnec, rundef)
DCL::uvbrf(rundef, xnec, xapl)
DCL::uvbrf(rundef, xapl, xibm)

DCL::uvbrl(rundef, xnec)
DCL::uvbrl(rundef, xapl)
DCL::uvbrl(rundef, xibm)

DCL::grcls

