Struct flow_sdk::algorithms::rand::distributions::UnitCircle [−][src]
pub struct UnitCircle;
Expand description
Samples uniformly from the edge of the unit circle in two dimensions.
Implemented via a method by von Neumann1.
Example
use rand::distributions::{UnitCircle, Distribution};
let circle = UnitCircle::new();
let v = circle.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. ↩
Implementations
Construct a new UnitCircle
distribution.
Trait Implementations
Generate a random value of T
, using rng
as the source of randomness.
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
Auto Trait Implementations
impl RefUnwindSafe for UnitCircle
impl Send for UnitCircle
impl Sync for UnitCircle
impl Unpin for UnitCircle
impl UnwindSafe for UnitCircle
Blanket Implementations
Mutably borrows from an owned value. Read more
Wrap the input message T
in a tonic::Request
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more