Math.kl¶
Types¶
UInt64 (struct)¶
SInt64 (struct)¶
Float64 (struct)¶
UInt8 (struct)¶
Scalar (struct)¶
UInt16 (struct)¶
UInt32 (struct)¶
Float32 (struct)¶
Functions¶
Math_clamp¶
Vec3_i Math_clamp ( in Vec3_i val, in Scalar minval, in Scalar maxval )
Clamps a Vec3_i value by min and max
Math_clamp¶
Vec3_i Math_clamp ( in Vec3_i val, in Scalar minval, in Scalar maxval )
Clamps a Vec3_i value by min and max
Math_linearInterpolate¶
Scalar Math_linearInterpolate ( in Scalar val1, in Scalar val2, in Scalar t )
Linearly interpolates a scalar value with another based on a blend (0.0 to 1.0)
Math_linearInterpolate¶
Scalar Math_linearInterpolate ( in Scalar val1, in Scalar val2, in Scalar t )
Linearly interpolates a scalar value with another based on a blend (0.0 to 1.0)
Math_lawOfCosine¶
Float32 Math_lawOfCosine ( in Float32 a, in Float32 b, in Float32 c )
Returns the law of cosine result
Math_reportWarning¶
Math_reportWarning ( in String desc )
Reports a mathematical warning and a call stack for the warning.
Math_badDivisor¶
Boolean Math_badDivisor ( in Float32 s )
Returns true if a divisor is outside the safe range of Float32 divisor values
Math_badDivisor¶
Boolean Math_badDivisor ( in Float32 s )
Returns true if a divisor is outside the safe range of Float32 divisor values
Math_reportBadDivisor¶
Math_reportBadDivisor ( in Float32 s, in String contextDesc )
Reports a Float32 bad divisor warning message
Math_reportBadDivisor¶
Math_reportBadDivisor ( in Float32 s, in String contextDesc )
Reports a Float32 bad divisor warning message
isZero¶
Boolean isZero ( in Float64 x )
Returns true if the provided Scalar value zero is within the Float32 precision range.
Math_aspectFromFov¶
Scalar Math_aspectFromFov ( in Scalar fovX, in Scalar fovY )
computes the aspect ratio based on two field of view angles in radians
Math_fovXtoY¶
Scalar Math_fovXtoY ( in Scalar fovX, in Scalar aspect )
computes the vertical field of view angle in radians given a horizontal field of view in radians and an aspect
Math_fovYtoX¶
Scalar Math_fovYtoX ( in Scalar fovY, in Scalar aspect )
computes the horizontal field of view angle in radians given a vertical field of view in radians and an aspect
findQuadraticRoots¶
Integer findQuadraticRoots ( in Float64 coeff[3], out Float64 re[2] )
Finds the roots of a quadratic equation. return(2): 2 real roots return(1): 1 real, Scalar root return(0): 2 complex roots
注釈
The imaginary component may be NULL if not desired.
coeff | The 3 coeffients to the quadratic equation. |
re | The roots of the quadratic equation |
findCubicRoots¶
Integer findCubicRoots ( in Float64 coeff[4], out Float64 roots[3] )
Finds the roots of a cubic equation equation. Solves: coeff[3] * x^3 + coeff[2] * x^2 + coeff[1] * x + coeff[0] = 0 returns: 3 - 3 real roots 1 - 1 real root (2 complex conjugate)
coeff | The 4 coeffients to the cubic equation. |
re | The roots of the cubic equation |