First page Back Continue Last page Overview Graphics
Often want to generate random initial conditions for a simulation, e.g. initial position & velocity.
Must take care when using transformations, since you may not get the distribution you expect.
For example, to fill a flat disk of radius R with random points is it better to:
- Fill a square and reject points with x2 + y2 > R2?
- Choose random and r then set x = rcos, y = rsin?