<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - comments on Post, random dots on an egg</title>
    <link>http://www.mapleprimes.com/posts/122970-Random-Dots-On-An-Egg</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Thu, 11 Jun 2026 11:51:44 GMT</lastBuildDate>
    <pubDate>Thu, 11 Jun 2026 11:51:44 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest comments added to the Post, random dots on an egg</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - comments on Post, random dots on an egg</title>
      <link>http://www.mapleprimes.com/posts/122970-Random-Dots-On-An-Egg</link>
    </image>
    <item>
      <title>Random points on a non-sphere</title>
      <link>http://www.mapleprimes.com/posts/122970-Random-Dots-On-An-Egg?ref=Feed:MaplePrimes:random dots on an egg:Comments#comment123654</link>
      <itunes:summary>&lt;p&gt;Your procedure would generate uniformly-distributed random points on a sphere, but when you map this to an ellipsoid the distribution may no longer be uniform with respect to area.&amp;nbsp; Suppose you generate random points for parameters (u,v) in a rectangle (in your case [-1,1] x [0,2*Pi]) and map (u,v) to F(u,v) in 3-dimensional space.&amp;nbsp; The mapping multiplies areas by the length of the cross product of the vectors &lt;img class="math" src="http://www.mapleprimes.com/MapleImage.ashx?f=ec43b8121f017129d94613755fd9715a.gif" alt="diff(F(u,v),u)"&gt; and &lt;img class="math" src="http://www.mapleprimes.com/MapleImage.ashx?f=b0d8bf18815b2a2579979c7933a7fab3.gif" alt="diff(F(u,v),v)"&gt;; call this C(u,v).&amp;nbsp; In order for the mapped points to be uniformly distributed with respect to area, you want the density of your points in (u,v) space to be proportional to C(u,v).&amp;nbsp; In your case&lt;/p&gt;
&lt;pre&gt;&lt;br&gt;F:= (u,v) -&amp;gt; &amp;lt;rX*sqrt(1-u^2)*cos(v), rY*sqrt(1-u^2)*sin(v), rZ*u&amp;gt;;&lt;br&gt;CP:= VectorCalculus:-CrossProduct(diff~(F(u,v),u), diff~(F(u,v),v));&lt;br&gt;C:= unapply(simplify(sqrt(CP[1]^2 + CP[2]^2 + CP[3]^2)),u,v);&lt;/pre&gt;
&lt;p&gt;We can obtain our (u,v) points by a rejection sampling method: start out with uniformly distributed points, and accept or reject each one, accepting with probability proportional to C(u,v).&amp;nbsp; If 0 &amp;lt; rX &amp;lt;= rY &amp;lt;= rZ, the maximum of C is at u=0, v=0, where C(0,0) = rY*rZ.&amp;nbsp; So we accept (u,v) with probability C/(rY*rZ).&amp;nbsp; For example:&lt;/p&gt;
&lt;p&gt;&amp;gt; rX, rY, rZ:= 0.5, 1, 1.5;&lt;br&gt;&amp;nbsp; C0:= rY*rZ;&lt;br&gt;&amp;nbsp;&amp;nbsp;with(Statistics):&lt;br&gt;&amp;nbsp; RawPts:= zip(`[]`,Sample(Uniform(-1,1),10000),Sample(Uniform(0,2*Pi),10000)): &lt;br&gt;&amp;nbsp; AVals:= Sample(Uniform(0,1),10000):&lt;br&gt;&amp;nbsp; Accepted:= select(i -&amp;gt; (AVals[i] &amp;lt; C(op(RawPts[i]))/C0), [$1..1000]):&lt;br&gt;&amp;nbsp; uvPts:= RawPts[Accepted];&lt;br&gt;&amp;nbsp; Pts:= map(p -&amp;gt; [rX*sqrt(1-p[1]^2)*cos(p[2]),rY*sqrt(1-p[1]^2)*sin(p[2]),rZ*p[1]], uvPts);&lt;br&gt;&amp;nbsp; plots[pointplot3d](Pts,axes=box,scaling=constrained,colour=red);&lt;/p&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=123654/416854/poe.jpg"&gt;&lt;img src="/view.aspx?sf=123654/416854/poe.jpg" alt=""&gt;&lt;/a&gt;&lt;br&gt;&amp;nbsp;&lt;a href="/view.aspx?sf=123654/416854/ptsonellipsoid.jpg"&gt;&lt;br&gt;&lt;/a&gt;&lt;/p&gt;</itunes:summary>
      <description>The latest comments added to the Post, random dots on an egg</description>
      <guid>123654</guid>
      <pubDate>Fri, 08 Jul 2011 00:30:44 Z</pubDate>
      <itunes:author>Robert Israel</itunes:author>
      <author>Robert Israel</author>
    </item>
    <item>
      <title>uniform</title>
      <link>http://www.mapleprimes.com/posts/122970-Random-Dots-On-An-Egg?ref=Feed:MaplePrimes:random dots on an egg:Comments#comment123802</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/posts/122970-Random-Dots-On-An-Egg#comment123654"&gt;@Robert Israel&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Great Robert, thanks a lot (I thought there was something a little odd for a small number of points),&lt;/p&gt;
&lt;p&gt;works great,&lt;/p&gt;
&lt;p&gt;Patrick.&lt;/p&gt;</itunes:summary>
      <description>The latest comments added to the Post, random dots on an egg</description>
      <guid>123802</guid>
      <pubDate>Wed, 13 Jul 2011 00:20:59 Z</pubDate>
      <itunes:author>PatrickT</itunes:author>
      <author>PatrickT</author>
    </item>
    <item>
      <title>How to test visually that it is not uniform with the least number of points</title>
      <link>http://www.mapleprimes.com/posts/122970-Random-Dots-On-An-Egg?ref=Feed:MaplePrimes:random dots on an egg:Comments#comment123806</link>
      <itunes:summary>&lt;p&gt;To me, visually,&amp;nbsp;I couldn't tell if they were uniformly distributed or not, although it&amp;nbsp;did look slightly more spaced at +45 degree and -45 degree latitudes.&lt;/p&gt;
&lt;p&gt;Is there a test that would visually make you say, ... Aha!&amp;nbsp; Yes it is not a uniform distribution.&amp;nbsp; And the trick here is to do it with the least number of points.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;How can we do that?&lt;/p&gt;
&lt;p&gt;**edit -add - What I mean is, is there a simple 2-d graph that would determine this?&amp;nbsp; I suppose we could plot the number of points vs. theta vs. phi?&amp;nbsp;&amp;nbsp;Then see if peaks occur?&lt;/p&gt;</itunes:summary>
      <description>The latest comments added to the Post, random dots on an egg</description>
      <guid>123806</guid>
      <pubDate>Wed, 13 Jul 2011 04:57:29 Z</pubDate>
      <itunes:author>Christopher2222</itunes:author>
      <author>Christopher2222</author>
    </item>
    <item>
      <title>@Christopher2222&amp;nbsp;
I don't know about</title>
      <link>http://www.mapleprimes.com/posts/122970-Random-Dots-On-An-Egg?ref=Feed:MaplePrimes:random dots on an egg:Comments#comment123891</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/posts/122970-Random-Dots-On-An-Egg#comment123806"&gt;@Christopher2222&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I don't know about graphically, I can think of two ways to test this mathematically: first, a test based on counts: for example the&amp;nbsp;&amp;chi;&lt;sup&gt;2&amp;nbsp;&lt;/sup&gt;dispersion test; and second, a test based on distances: for example Hopkins' test. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;If I have some spare time this weekend I might try to implement these for the case in hand.&lt;/p&gt;</itunes:summary>
      <description>The latest comments added to the Post, random dots on an egg</description>
      <guid>123891</guid>
      <pubDate>Fri, 15 Jul 2011 15:22:43 Z</pubDate>
      <itunes:author>longrob</itunes:author>
      <author>longrob</author>
    </item>
  </channel>
</rss>