# # sgpk08.rb # # $Id: sgpk08.rb,v 1.1 2000/11/21 03:02:08 keiko Exp $ # require "narray" require "numru/dcl" include NumRu include NMath upx3 = NArray.sfloat(3) upy3 = NArray.sfloat(3) upx6 = NArray.sfloat(6) upy6 = NArray.sfloat(6) upxs = NArray.sfloat(61) upys = NArray.sfloat(61) #-- data --- a = 0.8 th = 3.14159 * 2 / 3 upy3 = upy3.indgen * th + th upx3 = sin(upy3) * a upy3 = cos(upy3) * a th = 3.14159 * 2 / 6 upy6 = upy6.indgen * th + th upx6 = sin(upy6) * a upy6 = cos(upy6) * a th = 3.14159 * 4 / 60 upxs = upxs.indgen * a/30 - a upys = upys.indgen * th upys = sin(upys) * a #-- graph --- iws = (ARGV[0] || (puts ' WORKSTATION ID (I) ? ;'; DCL::sgpwsn; gets)).to_i DCL::sgopn iws DCL::sglset('LSOFTF', true) # <-- ソフトフィルの指定 DCL::sgfrm DCL::sgswnd(-1.0, 1.0, -1.0, 1.0) DCL::sgsvpt(0.0, 0.5, 0.0, 0.5) DCL::sgstrn(1) DCL::sgstrf DCL::sgplu(upx3, upy3) DCL::sgtnu(upx3, upy3) # <--網かけ(左下) DCL::sgsvpt(0.0, 0.5, 0.5, 1.0) DCL::sgstrf DCL::sgstnp(101) DCL::sgtnu(upx6, upy6) # <-- 横線 (左上) DCL::sgsvpt(0.5, 1.0, 0.0, 0.5) DCL::sgstrf DCL::sgtnzu(upx6, upy6, 201) # <--斜線(右下) DCL::sgsvpt(0.5, 1.0, 0.5, 1.0) DCL::sgstrf DCL::sgtnzu(upxs, upys, 601) # <-- 横線 (右上) DCL::sgcls