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");
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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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");
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?