Function pix_engine::math::noise

source ·
pub fn noise<V, const N: usize>(vector: V) -> f64
where V: Into<Vector<f64, N>>,
Expand description

Returns the Perlin noise value at specified coordinates.

Examples

use pix_engine::math::noise;

let n = noise([5.0]);
assert!(n >= 0.0 && n < 1.0);

let n = noise([2.0, 1.5]);
assert!(n >= 0.0 && n < 1.0);

let n = noise([2.0, 1.5, 3.0]);
assert!(n >= 0.0 && n < 1.0);