A point on a d-dimensional sphere

James Theiler jt@lanl.gov
Thu Jun 19 15:09:00 GMT 2003


you can use gsl_ran_dir_nd (see section 19.22), but the basic idea
is to generate d gaussian deviates {z_1,...,z_d} and then normalize
them using x_i = z_i/R, where R=sqrt(z_1^2+...z_d^2)

if d<4, there are tricks you can use to speed things up.

jt

On Thu, 19 Jun 2003, Sliwa, Przemyslaw wrote:

] Hi friends,
]
] Does anybody know how to generate a point on a d-dimensional sphere???
]
] Thanks,
]
] Przem
]
] Any e-mail message from the European Central Bank (ECB) is sent in good faith but shall neither be binding nor construed as constituting a commitment by the ECB except where provided for in a written agreement.
] This e-mail is intended only for the use of the recipient(s) named above. Any unauthorised disclosure, use or dissemination, either in whole or in part, is prohibited.
] If you have received this e-mail in error, please notify the sender immediately via e-mail and delete this e-mail from your system.
]




More information about the Gsl-discuss mailing list