Math.kl

Types

UInt64 (struct)

Methods

  UInt64 ( in UInt64 other )
  UInt64 ()
UInt64 clone ? ()
UInt64 linearInterpolate ? ( in UInt64 other, in Scalar t )

SInt64 (struct)

Methods

  SInt64 ( in SInt64 other )
  SInt64 ()
SInt64 clone ? ()
SInt64 linearInterpolate ? ( in SInt64 other, in Scalar t )

Float64 (struct)

Methods

  Float64 ( in Float64 other )
  Float64 ()
Float64 clamp ? ( in Float64 min, in Float64 max )
Float64 clone ? ()
Float64 linearInterpolate ? ( in Float64 other, in Scalar t )

UInt8 (struct)

Methods

  UInt8 ( in UInt8 other )
  UInt8 ()
UInt8 clone ? ()
UInt8 linearInterpolate ? ( in UInt8 other, in Scalar t )

Scalar (struct)

Methods

  Scalar ( in Scalar other )
  Scalar ()
Scalar clamp ? ( in Scalar min, in Scalar max )
Scalar clone ? ()

UInt16 (struct)

Methods

  UInt16 ( in UInt16 other )
  UInt16 ()
UInt16 clone ? ()
UInt16 linearInterpolate ? ( in UInt16 other, in Scalar t )

UInt32 (struct)

Methods

  UInt32 ( in UInt32 other )
  UInt32 ()
UInt32 clone ? ()
UInt32 linearInterpolate ? ( in UInt32 other, in Scalar t )

Float32 (struct)

Methods

  Float32 ( in Float32 other )
  Float32 ()
Float32 atomicGet ! ()
Float32 clone ? ()
Float32 linearInterpolate ? ( in Float32 other, in Scalar t )

SInt32 (struct)

Methods

  SInt32 ( in SInt32 other )
  SInt32 ()
SInt32 clone ? ()
SInt32 linearInterpolate ? ( in SInt32 other, in Scalar t )

Functions

fract

Float64 fract ( in Float64 val )

Returns the fractional component of the Float64 value.

fract

Float64 fract ( in Float64 val )

Returns the fractional component of the Float64 value.

Math_radToDeg

Scalar Math_radToDeg ( in Scalar val )

Converts radians to degrees

Math_degToRad

Scalar Math_degToRad ( in Scalar val )

Converts degrees to radians

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_max

RGBA Math_max ( in RGBA val1, in RGBA val2 )

Returns the minimum of two RGBA values

Math_max

RGBA Math_max ( in RGBA val1, in RGBA val2 )

Returns the minimum of two RGBA values

Math_min

RGBA Math_min ( in RGBA val1, in RGBA val2 )

Returns the minimum of two RGBA values

Math_min

RGBA Math_min ( in RGBA val1, in RGBA val2 )

Returns the minimum of two RGBA values

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.

cbrt

Float64 cbrt ( in Float64 v )

Returns the cube root of the given value.

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

sinh

Float64 sinh ( in Float64 x )

the hyperbolic of sin for Float64

cosh

Float64 cosh ( in Float64 x )

the hyperbolic of cos for Float64

tanh

Float64 tanh ( in Float64 x )

the hyperbolic of tangent for Float64

coth

Float64 coth ( in Float64 x )

the hyperbolic of cotangent for Float64

sech

Float64 sech ( in Float64 x )

the hyperbolic secant for Float64

csch

Float32 csch ( in Float32 x )

the hyperbolic secant for Float32

sinh

Float64 sinh ( in Float64 x )

the hyperbolic of sin for Float64

cosh

Float64 cosh ( in Float64 x )

the hyperbolic of cos for Float64

tanh

Float64 tanh ( in Float64 x )

the hyperbolic of tangent for Float64

coth

Float64 coth ( in Float64 x )

the hyperbolic of cotangent for Float64

sech

Float64 sech ( in Float64 x )

the hyperbolic secant for Float64

csch

Float32 csch ( in Float32 x )

the hyperbolic secant for Float32