Struct flow_sdk::algorithms::secp256k1::rand::distributions::UnitSphereSurface [−][src]
pub struct UnitSphereSurface;
Expand description
Samples uniformly from the surface of the unit sphere in three dimensions.
Implemented via a method by Marsaglia1.
Example
use rand::distributions::{UnitSphereSurface, Distribution};
let sphere = UnitSphereSurface::new();
let v = sphere.sample(&mut rand::thread_rng());
println!("{:?} is from the unit sphere surface.", v)
Marsaglia, George (1972). Choosing a Point from the Surface of a Sphere. Ann. Math. Statist. 43, no. 2, 645–646. ↩
Implementations
Construct a new UnitSphereSurface
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 UnitSphereSurface
impl Send for UnitSphereSurface
impl Sync for UnitSphereSurface
impl Unpin for UnitSphereSurface
impl UnwindSafe for UnitSphereSurface
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