pub struct Rng { /* private fields */ }Expand description
xorshift64* generator.
Implementations§
Source§impl Rng
impl Rng
pub fn new(seed: u64) -> Self
pub fn next_u64(&mut self) -> u64
Sourcepub fn next_range(&mut self, lo: f64, hi: f64) -> f64
pub fn next_range(&mut self, lo: f64, hi: f64) -> f64
Uniform float in [lo, hi).
Sourcepub fn next_direction2<S: Scalar>(&mut self) -> Vector2<S>
pub fn next_direction2<S: Scalar>(&mut self) -> Vector2<S>
A random direction, uniformly distributed on the unit circle.
Sourcepub fn next_direction3<S: Scalar>(&mut self) -> Vector3<S>
pub fn next_direction3<S: Scalar>(&mut self) -> Vector3<S>
A random direction, uniformly distributed on the unit sphere
(Archimedes’ cylindrical projection: uniform z, uniform angle).
Auto Trait Implementations§
impl Freeze for Rng
impl RefUnwindSafe for Rng
impl Send for Rng
impl Sync for Rng
impl Unpin for Rng
impl UnsafeUnpin for Rng
impl UnwindSafe for Rng
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more