use crate::prelude::*;

/// Sample a triangle
pub fn sample_triangle(uv: [Float; 2]) -> [Float; 3] {
    let s = 1.0 - Float::sqrt(1.0 - uv[0]);
    let t = (1.0 - s) * uv[1];
    [s, t, 1.0 - s - t]
}
