Codename LogoCodename Logo

funkin.backend.utils.MathUtil

APIWikiTools

Static methods

View on GitHub

staticequal(a:Float, b:Float, margin:Float = 0.0000001):Bool

Checks if a is approximately equal to b.

Parameters:

a

Float

b

Float

margin

Float (Default: EPSILON)

Returns:

Bool

View on GitHub

staticgreaterThan(a:Float, b:Float, margin:Float = 0.0000001):Bool

Checks if a is greater than b with considering a margin of error.

Parameters:

a

Float

b

Float

margin

Float (Default: EPSILON)

Returns:

Bool

View on GitHub

staticgreaterThanEqual(a:Float, b:Float, margin:Float = 0.0000001):Bool

Checks if a is greater than or equally b with considering a margin of error.

Parameters:

a

Float

b

Float

margin

Float (Default: EPSILON)

Returns:

Bool

View on GitHub

staticlessThan(a:Float, b:Float, margin:Float = 0.0000001):Bool

Checks if a is less than b with considering a margin of error.

Parameters:

a

Float

b

Float

margin

Float (Default: EPSILON)

Returns:

Bool

View on GitHub

staticlessThanEqual(a:Float, b:Float, margin:Float = 0.0000001):Bool

Checks if a is less than or equally b with considering a margin of error.

Parameters:

a

Float

b

Float

margin

Float (Default: EPSILON)

Returns:

Bool

View on GitHub

staticmax(args:Rest<Float>):Float

Returns the maximum value in the arguments.

NOTE: If you are using this in compile time, you should use MathUtil.maxSmart instead of this for better performance.

Parameters:

args

Array of values

Returns:

The maximum value

View on GitHub

staticmaxInt(args:Rest<Int>):Int

Returns the maximum value in the arguments.

Parameters:

args

Array of values

Returns:

The maximum value

View on GitHub

staticmin(args:Rest<Float>):Float

Returns the minimum value in the arguments.

NOTE: If you are using this in compile time, you should use MathUtil.minSmart instead of this for better performance.

Parameters:

args

Array of values

Returns:

The minimum value

View on GitHub

staticminInt(args:Rest<Int>):Int

Returns the minimum value in the arguments.

Parameters:

args

Array of values

Returns:

The minimum value

View on GitHub

staticnotEqual(a:Float, b:Float, margin:Float = 0.0000001):Bool

Checks if a are not approximately equal to b.

Parameters:

a

Float

b

Float

margin

Float (Default: EPSILON)

Returns:

Bool