[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2.7.12 Dots sample
Function 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++) { mreal 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; }
This document was generated on March 21, 2014 using texi2html 5.0.