zmath.aux
Some auxiliar math funtions
-
Declaration
enum realM_1_180;Inverse of 180
-
Declaration
pure nothrow @nogc @safe Tclamp(T = float)(in Tx) if (__traits(isFloating, T));Clamps a float point between -1.0 and +1.0
Parameters
TxFloat point number to
clampReturns A flot point number clamped between -1.0 and 1.0 -
Declaration
pure nothrow @nogc @safe TtoRadians(T = float)(in Tx) if (__traits(isFloating, T));Converts angles in degrees to radians
Parameters
TxAngle in grades Returns angle in radians
-
Declaration
pure nothrow @nogc @safe TtoDegrees(T = float)(in Tx) if (__traits(isFloating, T));Converts angles in radians to degrees
Parameters
TxAngle in radians REturns angle in grades
-
Declaration
intcmpFloat(T = float, U = float)(in Ta, in Ub, TmaxRelDiff= 0.01, TmaxAbsDiff= 1e-05);Compare two float point numbers with assuming that are equal if are in range of
maxAbsDiffParameters
TaA float point number
UbOther float point
TmaxRelDiffMax relative difference
TmaxAbsDiffMax absoulte difference Returns If a are aproximated equal that b, returns 0. Otherwise, if a > b, returns 1 and if a < b , returns -1;