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

2.7.12 Dots sample

Dots is another way to draw irregular points. Dots use color scheme for coloring (see Color scheme). The sample code is:

int sample(mglGraph *gr)
{
  int i, n=1000;
  mglData x(n),y(n),z(n);
  for(i=0;i<n;i++)
  {
    float t=M_PI*(mgl_rnd()-0.5), f=2*M_PI*mgl_rnd();
    x.a[i] = 0.9*cos(t)*cos(f);
    y.a[i] = 0.9*cos(t)*sin(f);
    z.a[i] = 0.6*sin(t);
  }
  gr->Title("Dots sample"); gr->Rotate(50,60);
  gr->Box();  gr->Dots(x,y,z);
  return 0;
}
Example of Dots()

This document was generated on April 13, 2012 using texi2html 5.0.

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