Anonymous - 2013-10-28

Recently I have installed the lasted MathGL(v2.1.3) in my computer, which is a win7 system, by means of downloading the package named "mathgl-2.1.3-mingw.i686.7z". I compiled some codes using MinGW (x86) and Eclipse.Here is my code file:

int sample(mglGraph *gr)
{
  gr->Rotate(60,40);
  gr->Box();
  return 0;
}

int main()
{
//
        mglGraph gr1;
gr1.FPlot("sin(pi*x)");
gr1.WriteFrame("Sin(PIx).png");

//
mglQT gr2(sample,"MathGL examples");
gr2.Run();

//
mglGraph gr3;
gr3.Alpha(true);   gr3.Light(true);
sample(&gr3);
gr3.WritePNG("D3PlotFrame.png");

//
mglData dat(30,40);

for(int i=0;i<30;i++)
for(int j=0;j<40;j++)
dat.a[i+30*j] = 1/(1+(i-15)(i-15)/225.+(j-20)(j-20)/400.);
mglGraph gr4; 
gr4.Rotate(50,60); 
gr4.Light(true); 
gr4.Surf(dat); // !!!!!Big problem!!!!
gr4.Cont(dat,"y");
gr4.Axis(); 
gr4.WritePNG("sample.png"); 

std::getwchar();
        return 0;
}
     Unfortunately I found that the binary program can not execute on the line: gr4.Surf(dat). Could anyone tell me what's the problem and how can I solve it?