import std.math;
import Dislin;

void main (string[] args)
{ int i, j, n = 50;
  float [50][50] zmat;
  double step, fpi, x, y;

  step = 360.f / (n-1);
  fpi = 3.1415926/180;

  for (i = 0; i < n; i++)
  { x = i * step;
    for (j = 0; j < n; j++)
    { y = j * step;
      zmat[i][j] = 2 * sin (x * fpi) * sin (y * fpi);
    }
  }
    
  metafl ("cons");
  disini ();
  hwfont ();
  pagera ();

  titlin ("3-D Colour Plot of the Function", 2);
  titlin ("F(X,Y) = 2 * SIN(X) * SIN(Y)", 4);

  name ("X-axis", "x");
  name ("Y-axis", "y");
  name ("Z-axis", "z");

  intax ();
  autres (n, n);
  axspos (300, 1850);
  ax3len (2200, 1400, 1400);

  graf3 (0.f, 360.f, 0.f, 90.f, 0.f, 360.f, 0.f, 90.f, 
         -2.f, 2.f, -2.f, 1.f);
  crvmat (cast (float *) zmat, n, n, 1, 1);

  height(50);
  title();
  disfin ();
}
