Big Tony
BigTony.Utility.Mathf Class Reference

Static Public Member Functions

static float Lerp (float a, float b, float t)
 Linear-Interpolate a certain distance between two floating point numbers. More...
 
static float Clamp (float val, float min, float max)
 Clamp a floating-point number between a maximum and minimum amount. More...
 
static float Max (float a, float b)
 Get the highest value between two inputted floating-point numbers. More...
 
static float Min (float a, float b)
 Get the lowest value between two inputted floating-point numbers. More...
 
static float Abs (float a)
 Get the absolute value of the inputted floating-point number. More...
 

Member Function Documentation

◆ Abs()

static float BigTony.Utility.Mathf.Abs ( float  a)
inlinestatic

Get the absolute value of the inputted floating-point number.

Parameters
aThe floating-point number to get the absolute value of.

The Math.abs() function returns the absolute value of a number. That is, it returns x if x is positive or zero, and the negation of x if x is negative.

Returns
The absolute value of 'a'.

◆ Clamp()

static float BigTony.Utility.Mathf.Clamp ( float  val,
float  min,
float  max 
)
inlinestatic

Clamp a floating-point number between a maximum and minimum amount.

Parameters
valThe value of the number that needs to be clamped.
minThe minimum amount that 'val' can be.
maxThe maximum amount that 'val' can be.
Returns
A clamped value of 'val' between 'min' and 'max'.

◆ Lerp()

static float BigTony.Utility.Mathf.Lerp ( float  a,
float  b,
float  t 
)
inlinestatic

Linear-Interpolate a certain distance between two floating point numbers.

Parameters
aThe first value to be interpolated between.
bThe second value to be interpolated between.
tThe amount that needs to be interpolated. This is expressed as a decimal value between '0' and '1'.
Returns
The number that is 't' distance between 'a' and 'b'.

◆ Max()

static float BigTony.Utility.Mathf.Max ( float  a,
float  b 
)
inlinestatic

Get the highest value between two inputted floating-point numbers.

Parameters
aThe first floating-point number to be compared.
bThe second floating-point number to be compared.
Returns
The highest value between 'a' and 'b'.

◆ Min()

static float BigTony.Utility.Mathf.Min ( float  a,
float  b 
)
inlinestatic

Get the lowest value between two inputted floating-point numbers.

Parameters
aThe first floating-point number to be compared.
bThe second floating-point number to be compared.
Returns
The lowest value between 'a' and 'b'.