user_guide:tutorials:random

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
tutorial:random [2011/08/04 07:58] – created joswiguser_guide:tutorials:random [2019/01/25 09:38] – ↷ Page moved from user_guide:random to user_guide:tutorials:random oroehrig
Line 1: Line 1:
 ====== Random Constructions ====== ====== 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.
 +<code>
 +polytope > $p1=rand_sphere(3,100);
 +polytope > print $p1->SIMPLICIAL;
 +1
 +</code>
 +With probability one such polytopes are simplicial.
  
 ===== Random polytopes with are neither simplicial nor simple ===== ===== Random polytopes with are neither simplicial nor simple =====
Line 7: Line 17:
 polytope > $p1=rand_sphere($d,$m); polytope > $p1=rand_sphere($d,$m);
 polytope > $p2=polarize($p1); polytope > $p2=polarize($p1);
-polytope > $p3=rand_vert($p1->VERTICES,$n);+polytope > $p3=new Polytope(POINTS=>rand_vert($p2->VERTICES,$n));
 polytope > print $p3->SIMPLICIAL, " ", $p3->SIMPLE, "\n", $p3->F_VECTOR; polytope > print $p3->SIMPLICIAL, " ", $p3->SIMPLE, "\n", $p3->F_VECTOR;
 0 0 0 0
 30 166 264 128 30 166 264 128
 </code> </code>
  • user_guide/tutorials/random.txt
  • Last modified: 2019/02/04 22:55
  • by 127.0.0.1