       RE: Random spherical troubles

• To: mathgroup at smc.vnet.net
• Subject: [mg25180] RE: [mg25170] Random spherical troubles
• From: "Ingolf Dahl" <ingolf.dahl at telia.com>
• Date: Tue, 12 Sep 2000 21:24:24 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```Barbara DaVinci wants to generate a set of directions randomly distributed
over the whole solid angle.

Hi Barbara!
There is a better way. Load

<<Statistics`ContinuousDistributions`

and generate three random numbers from the Normal distribution:

Table[Random[NormalDistribution[0, 1]], {3}]

If you want to be on the sure side, check that not all of these numbers are
zero. If we see these numbers as
the rectangular (Cartesian) coordinates for a vector, then this vector is
randomly distributed over the whole solid angle.
That follows from the fact that an orthogonal transformation of a number of
independent normal distributed [0,1] random
variables gives a new set of independent normal distributed variables with
the same parameters.
You can then normalize the vector to unit length if you like, or convert it
to spherical coordinates.

Ingolf Dahl
MINA, Chalmers University
f9aid at fy.chalmers.se

```

• Prev by Date: Re: Displaying 3D data as 2D + color ?
• Next by Date: Re: save a plot
• Previous by thread: Re: Random spherical troubles
• Next by thread: Re:Random spherical troubles