Previous: , Up: 1D samples   [Contents][Index]

3.5.26 Pmap sample

Function pmap draw Poincare map – show intersections of the curve and the surface. The sample code is:

int sample(mglGraph *gr)
  gr->Title("Poincare map sample");
  mglData ini(3);	ini[0]=0.1;
  mglData r(mglODE("cos(y)+sin(z);cos(z)+sin(x);cos(x)+sin(y)","xyz",ini,0.1,100));
  mglData x(r.SubData(0)),y(r.SubData(1)), z(r.SubData(2));
  gr->Rotate(40,60);  gr->SetRanges(x,y,z);
  gr->Axis(); gr->FSurf("0"); gr->Plot(x,y,z,"b");
  gr->Label('x',"\\i x",0);   gr->Label('y',"\\i y",0);   gr->Label('z',"\\i z",0);
  gr->Pmap(x,y,z,z, "b#o");

Example of Pmap()