< Frames sample No.8

8. 1次元配列を用いた3次元の小球図



ソースプログラム(Fortran 90,自動倍精度利用)
!******************************** ! 3D Graphic Sample No. 3 * ! Small Balls * !******************************** program gsample8 implicit none integer, parameter :: nmax = 100 real, parameter :: pi = 3.141592653589793, pi2 = pi*2 real xs(nmax),ys(nmax),zs(nmax),p,q real xmin,xmax,ymin,ymax,zmin,zmax integer cc(nmax),n1,i xmin = -20 xmax = 20 ymin = -20 ymax = 20 zmin = 0.0 zmax = 40.0 p = 0.1 q = (zmax-zmin)/nmax n1 = 76 do i = 1, n1 zs(i) = q*i xs(i) = 15*cos(pi2*p*zs(i)) ys(i) = 15*sin(pi2*p*zs(i)) zs(i) = 1.5*zs(i) enddo call fr_ginit call fr_opencanvas(1,'gsample8',101) call fr_project(5.0,1) call fr_margin3d(10,20,10,80) call fr_angle3d(40.0,-50.0) call fr_aspect3d(1.0,1.0,1.0,1) call fr_frame3d(xmin,xmax,ymin,ymax,zmin,zmax,3) call fr_xyzname('xxx','yyy','zzz') call fr_setcircle(23.0) do i = 1, n1 cc(i) = mod(i,7)+1 enddo call fr_graph3d(xs,ys,zs,n1,cc,-13) call fr_gend end program gsample8


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