[Numpy-discussion] Even Sphere Volume
Sun Jul 5 19:08:37 CDT 2009
2009/7/5 Stéfan van der Walt <firstname.lastname@example.org>
> 2009/7/5 Ian Mallett <email@example.com>:
> > @Stéfan: I thought of the first method. Let's hear the second approach.
> Please see the attached example.
> I start off by drawing random azimuth and elevation angles, as well as a
> N = 1000
> max_radius = 5
> az = np.random.uniform(low=0, high=np.pi * 2, size=N)
> el = np.random.uniform(low=0, high=np.pi, size=N)
> r = np.random.uniform(size=N)
> You can imagine your volume consisting of a large number of concentric
> spherical surfaces (almost like those Russian nested dolls). We'd
> like to have all of those surfaces equally densely packed, but their
> surfaces increase in area by the third power with radius. To counter
> this effect we do
> r = r ** (1/3.)
> Now, imagine the elevation contours (like latitude on the earth) for
> one of those spherical surfaces. If we choose them equally spaced,
> we'll have a much higher concentration of points near the north and
> south poles. Instead, we choose them according to
> el = np.arccos(1 - 2*el)
> so that we have more contours close to the equator (where the contours
> are longer and need more points).
> >From a statistical point of view, the derivation is done using
> transformation of random variables:
> Numpy-discussion mailing list
Do you have any idea, why spheres have rough edges on Mayavi?
Secondly, how to add an efficient random movement visualization into your
scene? Without considering collision, gravity, etc the details just letting
all particles freely move into this given spherical border.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion