Hi,
I have used the program below to create a random spherical
distribution of particles but realised that when the distribution is
viewed perpendicular to the z-axis a clear streak is seen running up
down along the plot.
Dave Fanning was contacted about this (see below) and we are both
unsure as to why this might occur and therefore how to get around it.
Does anyone have any suggestions of the cause of this pattern in a
supposedly random distribution?
cheers
Larry
pro rhodist2
Npartic=10000
sphericalCoords=fltarr(3,Npartic)
omega=RANDOMU(seed,Npartic,/UNIFORM,/DOUBLE) * 180.0
rho = RANDOMU(seed1,Npartic,/UNIFORM,/DOUBLE) * 360.0
radius = RANDOMU(seed2,Npartic,/UNIFORM,/DOUBLE)
sphericalCoords(0,*) = omega
sphericalCoords(1,*) = rho
sphericalCoords(2,*) = radius
rectCoords = CV_COORD(From_SPHERE=sphericalCoords, /To_Rect, /Degrees)
!p.multi=[0,1,3,0,0]
plot,rectCoords(0,*),rectCoords(1,*),psym=3
plot,rectCoords(0,*),rectCoords(2,*),psym=3
plot,rectCoords(1,*),rectCoords(2,*),psym=3
!p.multi=0
end
Hi Larry,
> further to my previous email, I have discovered that the program
I sent
> does not
>really show the problem, the problem is only evident in 3-d.
Please see
>below for the
>full program. When the distribution is viewed with the x and y
axes a
>distribution
>similar to the 2-d case is seen (as expected) but if the
distribution is
>viewed
>with the z axis an elliptical pattern running up-down is evident.
Surely
>the distribution should look
>reasonably similar viewed from any angle. I thought that this
would be of
>interest
>to you as there is a very similar program that shows the same
behaviour
>listed on your site.
Well, I've fooled around with this for several hours now,
and I don't know what to think. I wonder if it is not a sort
of map projection type of problem. We are taking numbers
that are uniformly distributed along a linear axis, if you like,
and re-projecting them into a spherical coordinate system.
Does the clumping we see have something to do with warping
a 3D rectilinear space into a 3D spherical space? It seems likely
to me, but I don't know how to prove it. The 3D random number
generators I've seen on the Internet all seem to distribute points
on the surface of the sphere, not throughout the sphere. What
is the reason for that?
I guess I think there must be some mathematical explanation
that we are both missing. This problem is pretty far afield from
any area of expertise I might have, anyway.
Why don't you ask this question on the IDL newsgroup. Some
of those math guys will eat this stuff up. :-)
The IDL newsgroup is comp.lang.idl-pvwave.
By the way, what program were you referring to on my site?
Best Regards,
David
|