Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1998
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

creating distributions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg14697] creating distributions
  • From: "Naum Phleger" <naum at terrapin.physics.ucsb.edu>
  • Date: Sun, 8 Nov 1998 21:15:54 -0500
  • Organization: UCSB
  • Sender: owner-wri-mathgroup at wolfram.com

    I want to distribute vectors for a given vector field evenly over
the surface of a sphere.  The easiest way that I have come up with is
to generate a random list of {theta,fi} pairs.  This makes the field
too dense at the north and south poles.  I would like to use a cosine
distribution to be used in my random number generator so that I get a
more uniform distribution.  Here is my code now, and what I would like
it to look more like.

density is the total number of vectors

NOW:
    pointlist=Table[{Random[Real,{ -pi/2 , pi/2 }], Random[Real,{ -pi ,
pi }]},{density,i}]

DESIRED
    pointlist=Table[{Random[CosDistribution,{ -pi/2 , pi/2 }],
Random[Real,{ -pi , pi }]},{density,i}]



              -NAUM


  • Prev by Date: defining "regions"
  • Next by Date: Re: How to transpose vector?
  • Previous by thread: Re: defining "regions"
  • Next by thread: Re: creating distributions