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

2.5.22 Torus sample

Function torus draw surface of the curve rotation. The sample code is:

int sample(mglGraph *gr)
{
  mglData y1,y2;  mgls_prepare1d(0,&y1,&y2);
  gr->SubPlot(2,2,0); gr->Title("Torus plot (default)");
  gr->Light(true);  gr->Rotate(50,60);  gr->Box();  gr->Torus(y1,y2);
  if(mini)  return;

  gr->SubPlot(2,2,1); gr->Title("'x' style"); gr->Rotate(50,60);
  gr->Box();  gr->Torus(y1,y2,"x");

  gr->SubPlot(2,2,2); gr->Title("'z' style"); gr->Rotate(50,60);
  gr->Box();  gr->Torus(y1,y2,"z");

  gr->SubPlot(2,2,3); gr->Title("'\\#' style"); gr->Rotate(50,60);
  gr->Box();  gr->Torus(y1,y2,"#");
  return 0;
}
Example of Torus()

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

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