Random Constructions

Random points on the unit sphere

The easiest way to randomly construct a polytope is by sampling points on the unit sphere. The following chooses 100 points on the units sphere in 3-space.

polytope > $p1=rand_sphere(3,100);
polytope > print $p1->SIMPLICIAL;
1

With probability one such polytopes are simplicial.

Random polytopes with are neither simplicial nor simple

polytope > ($d,$m,$n) = (4,50,30);
polytope > $p1=rand_sphere($d,$m);
polytope > $p2=polarize($p1);
polytope > $p3=new Polytope(POINTS=>rand_vert($p2->VERTICES,$n));
polytope > print $p3->SIMPLICIAL, " ", $p3->SIMPLE, "\n", $p3->F_VECTOR;
0 0
30 166 264 128
tutorial/random.txt · Last modified: 2017/06/12 13:45 by oroehrig
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki