Const
Computes eigenvalues and eigenvectors of a 3x3 symmetric matrix using the Jacobi method.
The input 3x3 symmetric matrix (will be modified during computation)
The output matrix that will contain the eigenvectors
The output vector that will contain the eigenvalues
0 on success, -1 if maximum iterations exceeded
Computes a normalized discrete Gaussian distribution where the sum of all ratios equals 1. The sampling points are positioned at integer intervals around the mean.
Configuration object for the Gaussian distribution
Optional
effectiveNumber of decimal places for precision (default: 4)
Number of sampling points in the distribution
Optional
mean?: numberMean of the Gaussian distribution (default: 0)
Variance of the Gaussian distribution
An array of normalized ratios that sum to 1
Converts a numeric value to a string formatted for GLSL float literals. Ensures that integer values are suffixed with ".0" for proper GLSL syntax.
The numeric value to convert
A string representation suitable for GLSL float literals
Converts degrees to radians.
The angle in degrees
The angle in radians
Formats a numeric value as a fixed-width financial string with 7 decimal places. Positive values are prefixed with a space for alignment.
The numeric value to format
A formatted string with consistent width for financial display
Calculates the cumulative distribution function (CDF) for a Gaussian distribution.
The value at which to evaluate the CDF
The mean of the Gaussian distribution
The standard deviation of the Gaussian distribution
The cumulative probability up to x
Calculates the inverse cumulative distribution function (inverse CDF) for a Gaussian distribution.
The cumulative probability (should be in range [0, 1])
The mean of the Gaussian distribution
The standard deviation of the Gaussian distribution
The value x such that CDF(x) = U
Checks whether a number is a power of two.
The number to check
True if the number is a power of two, false otherwise
Checks whether the given texture dimensions are both powers of two.
The width of the texture
The height of the texture
True if both dimensions are powers of two, false otherwise
Performs linear interpolation between two values.
The starting value
The ending value
The interpolation parameter (0 returns a, 1 returns b)
The interpolated value
Rounds very small values to zero and values very close to ±1 to exactly ±1. This helps reduce floating-point precision errors in calculations.
The value to normalize
The normalized value with small errors corrected
Packs a normalized 4D vector into a 2D vector using a specific encoding scheme. All input values must be in the range [-1, 1].
The x component of the vector (range: [-1, 1])
The y component of the vector (range: [-1, 1])
The z component of the vector (range: [-1, 1])
The w component of the vector (range: [-1, 1])
The encoding criteria/resolution
A 2-element array containing the packed values
Converts radians to degrees.
The angle in radians
The angle in degrees
Rounds a floating-point number to 7 decimal places to reduce precision errors.
The value to round
The rounded value
Converts a 32-bit floating point number to a 16-bit half-precision float. This implementation is based on the OpenEXR half-precision format with additional rounding. Implementation reference: https://gamedev.stackexchange.com/questions/17326/conversion-of-a-number-from-single-precision-floating-point-representation-to-a/17410#17410
A function that converts a number to half-precision float representation
A utility class containing various mathematical functions and operations. This class provides static methods for common mathematical computations including: