7.10.1  math.inc - Float functions and macros

even(N). A function to test whether N is even, returns 1 when true, 0 when false.
Parameters

odd(N). A function to test whether N is odd, returns 1 when true, 0 when false.
Parameters

Interpolate(GC, GS, GE, TS, TE, Method). Interpolation macro, interpolates between the float values TS and TE. The method of interpolation is cosine, linear or exponential. The position where to evaluate the interpolation is determined by the position of GC in the range GS - GE. See example.
Parameters:

Example:
  #declare A = Interpolate(0.5, 0, 1, 0, 10, 1);
  #debug str(A,0,2)
  // result A = 5.00

  #declare A = Interpolate(0.0,-2, 2, 0, 10, 1);
  #debug str(A,0,2)
  // result A = 5.00

  #declare A = Interpolate(0.5, 0, 1, 0, 10, 2);
  #debug str(A,0,2)  
  // result A = 2.50

Mean(A). A macro to compute the average of an array of values.
Parameters:

Std_Dev(A, M). A macro to compute the standard deviation.
Parameters:

GetStats(ValArr). This macro declares a global array named "StatisticsArray" containing: N, Mean, Min, Max, and Standard Deviation
Parameters:

Histogram(ValArr, Intervals). This macro declares a global, 2D array named "HistogramArray". The first value in the array is the center of the interval/bin, the second the number of values in that interval.
Parameters:

sind(v), cosd(v), tand(v), asind(v), acosd(v), atan2d(a, b). These functions are versions of the trigonometric functions using degrees, instead of radians, as the angle unit.
Parameters:
The same as for the analogous built-in trig function.

max3(a, b, c). A function to find the largest of three numbers.
Parameters:

min3(a, b, c). A function to find the smallest of three numbers.
Parameters:

f_sqr(v). A function to square a number.
Parameters:

sgn(v). A function to show the sign of the number. Returns -1 or 1 depending on the sign of v.
Parameters:

clip(V, Min, Max). A function that limits a value to a specific range, if it goes outside that range it is "clipped". Input values larger than Max will return Max, those less than Min will return Min.
Parameters:

clamp(V, Min, Max). A function that limits a value to a specific range, if it goes outside that range it is "clamped" to this range, wrapping around. As the input increases or decreases outside the given range, the output will repeatedly sweep through that range, making a "sawtooth" waveform.
Parameters:

adj_range(V, Min, Max). A function that adjusts input values in the range [0, 1] to a given range. An input value of 0 will return Min, 1 will return Max, and values outside the [0, 1] range will be linearly extrapolated (the graph will continue in a straight line).
Parameters:

adj_range2(V, InMin, InMax, OutMin, OutMax). Like f_range(), but adjusts input values in the range [InMin, InMax] to the range [OutMin, OutMax].
Parameters: