5. 1次元配列を用いた2次元の線図の隠線処理付き重ね描き



ソースプログラム(Fortran 90,自動倍精度利用)
!**************************************** ! Parametric Graphic Sample No. 1 * !**************************************** program gsample5 implicit none integer, parameter :: imax = 100, jmax = 50 real x(0:imax),y(0:imax) real xmin,xmax,ymin,ymax,zmin,zmax,dx,dz real func,z,t integer i,j xmin = -15 xmax = 15 ymin = -10 ymax = 10 zmin = -15 zmax = 15 dx = (xmax-xmin)/imax dz = (zmax-zmin)/jmax call fr_ginit call fr_opencanvas(1,'gsample5',101) call fr_xyzname('x-axis','z-axis','y-axis') call fr_pmframe(xmin,xmax,ymin,ymax,zmin,zmax,3) call fr_hclear(1) t = 0 do j = 0, jmax z = dz*j + zmin do i = 0, imax x(i) = dx*i+xmin y(i) = func(dx*i+xmin,z,0.0) enddo call fr_pmgraph(x,y,z,imax+1,2,-1) enddo call fr_gend end program gsample5 function func(x,y,vt) implicit none real func,x,y,vt,xx xx = x*x + y*y func = 15.0*cos(sqrt(xx)-vt)*exp(-(0.01*xx+50*vt*vt)) end function func


Copyright (C) Toshihiro Taguchi, Setsunan University, 2000-2012 All rights reserved.