Calculates the absolute value.
Calculates the absolute value per component.
Compares to values and returns true if the difference is epsilon or smaller.
Compiletime version of degrees.
Returns min(max(x, min_val), max_val), Results are undefined if min_val > max_val.
Compiletime version of radians.
Converts radians to degrees.
Returns 1/sqrt(x), results are undefined if x <= 0.
Modulus. Returns x - y * floor(x/y).
Converts degrees to radians.
Returns 1.0 if x > 0, 0.0 if x = 0, or -1.0 if x < 0.
Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth hermite interpolation between 0 and 1 when edge0 < x < edge1. This is useful in cases where you would want a threshold function with a smooth transition.
Returns 0.0 if x < edge, otherwise it returns 1.0.
gl3n.math
Provides nearly all GLSL functions, according to spec 4.1, it also publically imports other useful functions (from std.math, core.stdc.math, std.alogrithm) so you only have to import this file to get all mathematical functions you need.
Publically imports: PI, sin, cos, tan, asin, acos, atan, atan2, sinh, cosh, tanh, asinh, acosh, atanh, pow, exp, log, exp2, log2, sqrt, abs, floor, trunc, round, ceil, modf, fmodf, min, max.