Struct rand_distr::UnitCircle [−][src]
pub struct UnitCircle;
Samples uniformly from the edge of the unit circle in two dimensions.
Implemented via a method by von Neumann1.
Example
use rand_distr::{UnitCircle, Distribution}; let v: [f64; 2] = UnitCircle.sample(&mut rand::thread_rng()); println!("{:?} is from the unit circle.", v)
von Neumann, J. (1951) Various Techniques Used in Connection with Random Digits. NBS Appl. Math. Ser., No. 12. Washington, DC: U.S. Government Printing Office, pp. 36-38. ↩
Trait Implementations
impl Clone for UnitCircle
[src]
impl Clone for UnitCircle
[src]fn clone(&self) -> UnitCircle
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<F: Float + SampleUniform> Distribution<[F; 2]> for UnitCircle
[src]
impl<F: Float + SampleUniform> Distribution<[F; 2]> for UnitCircle
[src]