uniform_sample_hemisphere

Function uniform_sample_hemisphere 

Source
pub fn uniform_sample_hemisphere(
    u1: f64,
    u2: f64,
    normal: &Vector3D,
) -> Vector3D
Expand description

Returns randomly sampled point within a unit hemisphere.

For a given unit hemisphere, defined by center normal vector, this function returns a point within the hemisphere.

  • Parameters:
    • u1: First random sample.
    • u2: Second random sample.
    • normal: The center normal of the hemisphere.
  • Returns: Sampled point.