public void TestDiscreteSurfaceValues() { var curve = new DiscreteSurface(_rows, _pointCoords, VMatrix); for (int i = 0; i < curve.GetPointList().Count; i++) { var point = curve.GetPointList()[i]; var closest = curve.GetClosestValues(point); foreach (var close in closest) { Console.WriteLine(" X: {0} Y : {1} Value1 : {2} Value2 : {3}", close.Coords[0], close.Coords[1], close.Coords[2], close.FunctionValue); } } }
public void TestDiscreteSurfaceClosestValues() { var curve = new DiscreteSurface(_rows, _pointCoords, VMatrix); var point = new Point2D(0.3, 0.5); var closest = curve.GetClosestValues(point); Assert.AreEqual(closest[0].Coords[0], 0.22); Assert.AreEqual(closest[0].Coords[1], 0.5d); Assert.AreEqual(closest[0].FunctionValue, 0.055d); Assert.AreEqual(closest[1].Coords[0], 0.22d); Assert.AreEqual(closest[1].Coords[1], 0.5d); Assert.AreEqual(closest[1].FunctionValue, 0.055d); Assert.AreEqual(closest[2].Coords[0], 1.0d); Assert.AreEqual(closest[2].Coords[1], 0.5d); Assert.AreEqual(closest[2].FunctionValue, 0.075d); Assert.AreEqual(closest[3].Coords[0], 1.0d); Assert.AreEqual(closest[3].Coords[1], 0.5d); Assert.AreEqual(closest[3].FunctionValue, 0.075d); }