Math

Miscellaneous math functions.

Bias
Standard bias function between 0-1.
Clamp
Clamps a number between two floats.
ClampPnt2
Clamps the components of a point2 value between two floats.
fMax
Returns the larger of two floats.
fMin
Returns the smaller of two floats.
Gain
Standard gain function between 0-1.
GetClosestPoints
Find the closest points to thisP. (requires AVGDLX.dlx)
Round
Round an integer, float, point2, or point3.
SmoothStep
Step smoothly between two floats.

Bias:

Standard bias function between 0-1.

Returns:

The passed float biased by the passed bias value.

Arguments:
<x>
The number to bias.
<b>
The bias value.

Back to top...


Clamp:

Clamps a number between two floats.

Returns:

The passed number clamped between the range of a to b.

Arguments:
<x>
The number to clamp.
<minVal>
The minimum allowed value for x.
<maxVal>
The maximum allowed value for x.

Back to top...


ClampPnt2:

Clamps the components of a point2 value between two floats.

Returns:

A new point2 value with its individual components clamped between the two floats.

Arguments:
<aPoint2>
The point2 to clamp.
<minVal>
The minimum allowed value.
<maxVal>
The maximum allowed value.

Back to top...


fMax:

Returns the larger of two floats.

Returns:

Returns the larger of two floats.

Arguments:
<a>
A float.
<b>
A float.

Back to top...


fMin:

Returns the smaller of two floats.

Returns:

Returns the smaller of two floats.

Arguments:
<a>
A float.
<b>
A float.

Back to top...


Gain:

Standard gain function between 0-1.

Returns:

The passed float cranked by the passed gain value.

Arguments:
<x>
The number to have gain applied to.
<g>
The gain value.

Back to top...


GetClosestPoints:

Find the closest points to thisP. (requires AVGDLX.dlx)

Returns:

Returns array, where:

<returnArray[1]>
An array of indicies, where returnArray[1][1] is the closest point, and returnArray[1][posArray.count] is the farthest.
<returnArray[2]>
An array of distances from thisP, where returnArray[2][n] corresponds to the index in returnArray[1][n].

Arguments:
<thisP>
The Point3 you're intersted in.
<posArray>
An array of Point3's.

Back to top...


Round:

Round an integer float, point2, or point3.

Returns:

The passed value "n" rounded to "prec" decimal places.

Arguments:
<n>
The number to be rounded. It can be a float, point2, or point3.
<g>
The number of decimal places to be rounded to. If the number is negative, then round works with whole numbers (ie. -1 rounds to the nearest tens, -2 rounds to the nearest hundreds, etc)

Back to top...


SmoothStep:

Step smoothly between two floats.

Returns:

The x value smoothly interpolated between a and b.

Arguments:
<x>
The normalized point (0-1) between a and b.
<a>
The minimum value to interpolate between.
<b>
The maximum value to interpolate between.

Back to top...