object IM →000001= new InterpolationMatrix(3);
→000002IM.AddPoint(0, 0, 0, 0, 0);
→000003IM.AddPoint(5, 5, 10, 20, 30);
→000004IM.AddPoint(-5, 5, -5, -6, -7);
→000005IM.AddPoint(5, -5, 5, 6, 7);
→000022TEXT("Examples of interpolation:");
→000006object Values1;
bool B1 →000007= IM.TryInterpolate(1, 1, 10, 10, out Values1);
→000008TEXT("Interpolated values in point [1;2] = " & Values1[0] & "; " & Values1[1] & "; " & Values1[2]);
→000009object Values2;
bool B2 →000010= IM.TryInterpolate(-1, 2, 10, 10, out Values2);
→000011TEXT("Interpolated values in point [-1;2] = " & Values2[0] & "; " & Values2[1] & "; " & Values2[2]);
→000012object Values3;
bool B3 →000013= IM.TryInterpolate(2, -1, 10, 10, out Values3);
→000014TEXT("Interpolated values in point [1;2] = " & Values3[0] & "; " & Values3[1] & "; " & Values3[2]);
→000023TEXT("Failed to interpolate:");
→000025object Values4;
bool B4 →000026= IM.TryInterpolate(1, 1, 1, 1, out Values4);
→000021TEXT("Unable to interpolate, because there is no point within the tolerance.");
→000024TEXT("(tolerance is maximum distance between [X,Y] and existing points in the matrix)");
→000019object Values5;
bool B5 →000020= IM.TryInterpolate(50, 50, 10, 10, out Values5);
→000027TEXT("Unable to interpolate, because [50, 50] is outside range of existing points.");
http://designforms.net
Calculation
Layout 0
Layout 1
Layout 2
Layout 3
Layout 4
Layout 5
-
"Interpolated values in point [1;2] = " & Values1[0] & "; " & Values1[1] & "; " & Values1[2]
-
"Interpolated values in point [-1;2] = " & Values2[0] & "; " & Values2[1] & "; " & Values2[2]
-
"Interpolated values in point [1;2] = " & Values3[0] & "; " & Values3[1] & "; " & Values3[2]
-
"Tolerance is maximum distance to existing point in the matrix."
-
"Unable to interpolate in points outside existing net: "
-
"Unable to interpolate, because there is no point within the tolerance."
-
"Examples of interpolation:"
-
"Failed to interpolate:"
-
"(tolerance is maximum distance between [X,Y] and existing points in the matrix)"
-
"Unable to interpolate, because [50, 50] is outside range of existing points."