LitDev.LDStatistics.InterpolateX C# (CSharp) Method

InterpolateX() public static method

Interpolate a 1D data array to find the value of x(y). The values of y should be monotonically increasing with x.
public static InterpolateX ( Primitive array, Primitive y ) : Primitive
array Primitive The array to interpolate (array[x]=y).
y Primitive The value of y (may be an array of y values).
return Primitive
        public static Primitive InterpolateX(Primitive array, Primitive y)
        {
            formData(array);

            if (SBArray.GetItemCount(y) == 0)
            {
                return interpolateX(y);
            }
            else
            {
                setPoints(y);
                string result = "";
                for (int i = 0; i < points.Count; i++)
                {
                    result += (i + 1).ToString() + "=" + interpolateX(points[i]).ToString(CultureInfo.InvariantCulture) + ";";
                }
                return Utilities.CreateArrayMap(result);
            }
        }