pub fn cosine_sample_hemisphere(u: &Point2f) -> Vector3f {
    let d: Point2f = concentric_sample_disk(u);
    let z: Float = (0.0 as Float)
        .max(1.0 as Float - d.x * d.x - d.y * d.y)
        .sqrt();
    Vector3f { x: d.x, y: d.y, z }
}
/// Cosine-weighted hemisphere sampling using Malley's method.
Cosine-weighted hemisphere sampling using Malley's method.
Cosine - weighted hemisphere sampling using Malley ' s method .
pub fn cosine_sample_hemisphere(u: &Point2f) -> Vector3f {
    let d: Point2f = concentric_sample_disk(u);
    let z: Float = (0.0 as Float)
        .max(1.0 as Float - d.x * d.x - d.y * d.y)
        .sqrt();
    Vector3f { x: d.x, y: d.y, z }
}
pub fn cosine_sample_hemisphere ( u : & Point2f ) -> Vector3f { let d : Point2f = concentric_sample_disk ( u ) ; let z : Float = ( 0.0 as Float ) . max ( 1.0 as Float - d . x * d . x - d . y * d . y ) . sqrt ( ) ; Vector3f { x : d . x , y : d . y , z } }
Cosine-weighted hemisphere sampling using Malley's method.
Cosine - weighted hemisphere sampling using Malley ' s method .
u
&Point2f