<p>J.F. Williamson, &quot;Random selection of points distributed on curved surfaces&quot;, <em>Physics in Medicine &amp; Biology</em> 32(10), 1987, describes a general method of choosing a uniformly random point on a parametric surface. It is an acceptance/rejection method that accepts or rejects each candidate point depending on its stretch factor (norm-of-gradient). To use this method for a parametric surface, several things have to be known about the surface, namely—</p>
<ul>
<li><p><code>x(u, v)</code>, <code>y(u, v)</code> and <code>z(u, v)</code>, which are functions that generate 3-dimensional coordinates from two dimensional coordinates <code>u</code> and <code>v</code>,</p>
</li>
<li><p>The ranges of <code>u</code> and <code>v</code>,</p>
</li>
<li><p><code>g(point)</code>, the norm of the gradient (&quot;stretch factor&quot;) at each point on the surface, and</p>
</li>
<li><p><code>gmax</code>, the maximum value of <code>g</code> for the entire surface.</p>
</li>
</ul>
<p>The algorithm is then:</p>
<ul>
<li>Generate a point on the surface, <code>xyz</code>.</li>
<li>If <code>g(xyz) &gt;= RNDU01()*gmax</code>, where <code>RNDU01()</code> is a uniform random variate in [0, 1), accept the point. Otherwise, repeat this process.</li>
</ul>
<p>Chen and Glotzer (2007) apply the method to the surface of a prolate spheroid (one form of ellipsoid) in &quot;Simulation studies of a phenomenological model for elongated virus capsid formation&quot;, <em>Physical Review E</em> 75(5), 051504 (<a href="https://arxiv.org/abs/cond-mat/0701125" rel="nofollow noreferrer">preprint</a>).</p>
How to generate a random sample of points from a 3-D ellipsoid using Python?
<p>I am trying to sample around 1000 points from a 3-D ellipsoid, uniformly. Is there some way to code it such that we can get points starting from the equation of the ellipsoid?</p>

<p>I want points on the surface of the ellipsoid.</p>