Previous: Bifurcation sample, Up: 1D samples [Contents][Index]
Function pmap draw Poincare map – show intersections of the curve and the surface. The sample code is:
int sample(mglGraph *gr) { gr->SubPlot(1,1,0,"<_^"); 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"); }