manpagez: man pages & more
info mathgl_en
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.8.4 Flow sample

Function flow is another standard way to visualize vector fields – it draw lines (threads) which is tangent to local vector field direction. MathGL draw threads from edges of bounding box and from central slices. Sometimes it is not most appropriate variant – you may want to use FlowP to specify manual position of threads. Flow use color scheme for coloring (see Color scheme). At this warm color corresponds to normal flow (like attractor), cold one corresponds to inverse flow (like source). The sample code is:

int sample(mglGraph *gr)
{
  mglData a,b;  mgls_prepare2v(&a,&b);
  gr->SubPlot(2,2,0,""); gr->Title("Flow plot (default)");
  gr->Box();  gr->Flow(a,b);

  gr->SubPlot(2,2,1,"");  gr->Title("'v' style");
  gr->Box();  gr->Flow(a,b,"v");

  gr->SubPlot(2,2,2,"");  gr->Title("'\\#' style");
  gr->Box();  gr->Flow(a,b,"#");

  mglData ex,ey,ez; mgls_prepare3v(&ex,&ey,&ez);
  gr->SubPlot(2,2,3); gr->Title("3d variant");  gr->Rotate(50,60);
  gr->Box();  gr->Flow(ex,ey,ez);
  return 0;
}
Example of Flow()

This document was generated on March 21, 2014 using texi2html 5.0.

© manpagez.com 2000-2025
Individual documents may contain additional copyright information.