# 12.21 Examples

## 12.17 Examples

                PROGRAM EXA12_1
                DIMENSION IXP(4),IYP(4)
                DATA IXP/150,1949,1949,150/ IYP/2600,2600,801,801/
                EXTERNAL ZFUN

                CALL SETPAG('DA4P')
                CALL DISINI
                CALL PAGERA
                CALL COMPLX

                CALL AXSPOS(200,2600)
                CALL AXSLEN(1800,1800)
                CALL NAME('X-axis','X')
                CALL NAME('Y-axis','Y')
                CALL NAME('Z-axis','Z')
                CALL TITLIN('Surface Plot (SURFUN)',2)
                CALL TITLIN('F(X,Y) = 2*SIN(X)*SIN(Y)',4)

                CALL GRAF3D(0.,360.,0.,90.,0.,360.,0.,90.,-3.,3.,-3.,1.)
                CALL HEIGHT(50)
                CALL TITLE
                CALL SHLSUR
                CALL SURFUN(ZFUN,1,10.,1,10.)

          C     Grid in the XY plane
                CALL GRFINI(-1.,-1.,-1.,1.,-1.,-1.,1.,1.,-1.)
                CALL NOGRAF
                CALL GRAF(0.,360.,0.,90.,0.,360.,0.,90.)
                CALL DASHL
                CALL GRID(1,1)
                CALL GRFFIN

          C     Grid in the YZ plane
                CALL GRFINI(-1.,-1.,-1.,-1.,1.,-1.,-1.,1.,1.)
                CALL GRAF(0.,360.,0.,90.,-3.,3.,-3.,1.)
                CALL GRID(1,1)
                CALL GRFFIN

          C     Shading in the XZ plane
                CALL GRFINI(-1.,1.,-1.,1.,1.,-1.,1.,1.,1.)
                CALL SHDPAT(7)
                CALL SOLID
                CALL AREAF(IXP,IYP,4)
                CALL GRFFIN

                CALL DISFIN
                END

                FUNCTION ZFUN(X,Y)
                FPI=3.14159/180.
                ZFUN=2*SIN(X*FPI)*SIN(Y*FPI)
                END

Figure 12.1: Surface Plot