pub fn random_in_unit_disk() -> Vector3 {
        let mut rng = rand::thread_rng();
        let mut p;
        loop {
            p = Vector3::new(rng.gen::<f32>(), rng.gen::<f32>(), 0.0) * 2.0 - Vector3::new(1.0, 1.0, 0.0);

            if Vector3::dot(p, p) < 1.0 {
                break;
            }
        }

        p
    }
/// Returns a random `Vector3` in a unit disk.
Returns a random `Vector3` in a unit disk.
Returns a random ` Vector3 ` in a unit disk .
pub fn random_in_unit_disk() -> Vector3 {
        let mut rng = rand::thread_rng();
        let mut p;
        loop {
            p = Vector3::new(rng.gen::<f32>(), rng.gen::<f32>(), 0.0) * 2.0 - Vector3::new(1.0, 1.0, 0.0);
            if Vector3::dot(p, p) < 1.0 {
                break;
            }
        }
        p
    }
pub fn random_in_unit_disk ( ) -> Vector3 { let mut rng = rand :: thread_rng ( ) ; let mut p ; loop { p = Vector3 :: new ( rng . gen :: < f32 > ( ) , rng . gen :: < f32 > ( ) , 0.0 ) * 2.0 - Vector3 :: new ( 1.0 , 1.0 , 0.0 ) ; if Vector3 :: dot ( p , p ) < 1.0 { break ; } } p }
Returns a random `Vector3` in a unit disk.
Returns a random ` Vector3 ` in a unit disk .