11. 2次元配列を用いた3次元曲面への等高色分布写像



ソースプログラム(Fortran 90,自動倍精度利用)
!******************************** ! 3D Graphic Sample No. 6 * ! Color Map on Sphere * !******************************** program gsample11 implicit none integer, parameter :: imax = 31, jmax = 31 real, parameter :: pi = 3.141592653589793 real x(imax,jmax),y(imax,jmax),z(imax,jmax),f(imax,jmax) real r,ph,th,dph,dth integer i,j r = 1 dph = 2*pi/(jmax-1) dth = pi/(imax-1) do j = 1, jmax ph = dph*(j-1) do i = 1, imax th = dth*(i-1) x(i,j) = r*sin(th)*cos(ph) y(i,j) = r*sin(th)*sin(ph) z(i,j) = r*cos(th) f(i,j) = exp(-4*(th-pi/2)**2-0.8*(ph-pi)**2) enddo enddo call fr_ginit call fr_opencanvas(1,'gsample11',101) call fr_project(5.0,1) call fr_margin3d(50,30,50,80) call fr_angle3d(20.0,150.0) call fr_aspect3d(1.0,1.0,1.0,0) call fr_xyzname('x-ax','y-ax','z-ax') call fr_frame3d(-1.0,1.0,-1.0,1.0,-1.0,1.0,3) call fr_mapsurface(x,y,z,f,imax,jmax,-2,1) call fr_gend end program gsample11


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