1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use cratesum;
/// Create a normalized Gaussian distribution over a specified range.
///
/// # Description
///
/// Creates a discrete Gaussian distribution by sampling the continuous Gaussian
/// probability density function at evenly spaced points across a given range.
/// The resulting distribution is normalized so that all values sum to `1.0`.
/// This function implements the Gaussian probability density function:
///
/// ```text
/// f(x) = exp(-((x - μ)² / (2σ²)))
/// ```
///
/// Where:
/// - `x` is the position along the range.
/// - `μ` is the center (mean).
/// - `σ` is the sigma (standard deviation).
///
/// # Arguments
///
/// * `sigma`: The standard deviation of the Gaussian distribution (_i.e._ the
/// width).
/// * `bins`: The number of discrete points to sample the Gaussian distribution.
/// * `range`: The total width of the sampling range.
/// * `center`: The mean (center) of the Gaussian distribution (_i.e._ the
/// peak).
///
/// # Returns
///
/// * `Vec<f64>`: The normalized Gaussian distribution.