Struct rand::distributions::UnitSphereSurface
source · [−]pub struct UnitSphereSurface;
👎 Deprecated since 0.7.0:
moved to rand_distr crate
Expand description
Samples uniformly from the surface of the unit sphere in three dimensions.
Implemented via a method by Marsaglia1.
Marsaglia, George (1972). Choosing a Point from the Surface of a Sphere. Ann. Math. Statist. 43, no. 2, 645–646. ↩
Implementations
sourceimpl UnitSphereSurface
impl UnitSphereSurface
sourcepub fn new() -> UnitSphereSurface
pub fn new() -> UnitSphereSurface
Construct a new UnitSphereSurface
distribution.
Trait Implementations
sourceimpl Clone for UnitSphereSurface
impl Clone for UnitSphereSurface
sourcefn clone(&self) -> UnitSphereSurface
fn clone(&self) -> UnitSphereSurface
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for UnitSphereSurface
impl Debug for UnitSphereSurface
sourceimpl Distribution<[f64; 3]> for UnitSphereSurface
impl Distribution<[f64; 3]> for UnitSphereSurface
sourcefn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> [f64; 3]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> [f64; 3]
Generate a random value of T
, using rng
as the source of randomness.
sourcefn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘNotable traits for DistIter<D, R, T>impl<D, R, T> Iterator for DistIter<D, R, T> where
D: Distribution<T>,
R: Rng, type Item = T;
where
R: Rng,
Self: Sized,
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘNotable traits for DistIter<D, R, T>impl<D, R, T> Iterator for DistIter<D, R, T> where
D: Distribution<T>,
R: Rng, type Item = T;
where
R: Rng,
Self: Sized,
D: Distribution<T>,
R: Rng, type Item = T;
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
impl Copy for UnitSphereSurface
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more