Reset platonic code.
[voro++.git] / trunk / examples / basic / convex_test.cc
blob6dee3fd294dfe6cb2823ed875f0a3b15a60f694a
1 // Single Voronoi cell example code
2 //
3 // Author : Chris H. Rycroft (Harvard SEAS / LBL)
4 // Email : chr@alum.mit.edu
5 // Date : February 16th 2014
7 #include "voro++.hh"
8 using namespace voro;
10 // This function returns a random floating point number between 0 and 1
11 double rnd() {return double(rand())/RAND_MAX;}
13 int main() {
14 // double x,y,z,rsq,r;
15 voronoicell v;
17 v.init_l_shape();
18 v.draw_gnuplot(0,0,0,"single_cell.gnu");
19 int lp=-1,ls=-1;
20 double l=1e-20,u=1e-20;
21 //bool suc=v.search_upward(-1,3,0,0.5,lp,ls,l,u);
22 v.plane(-1,3,0,0.5);
23 v.draw_gnuplot(0,0,0,"single_cell2.gnu");
24 v.plane(-1,3,0.4,0.53);
25 v.plane(-1,3,-0.4,0.54);
26 puts("cr");
27 v.check_relations();
28 v.check_duplicates();
29 puts("fi");
30 // v.plane(-1,3,-0.2,0.54);
31 bool suc=true;
33 printf("%s lp=%d ls=%d l=%g u=%g up=%d\n",suc?"True":"False",lp,ls,l,u,v.up);
35 v.draw_gnuplot(0,0,0,"single_cell3.gnu");