示例#1
0
        TestDiscreteSurface2()
        {
            var curve     = new DiscreteSurface(_rows, _pointCoords, VMatrix);
            var result    = curve.GetMatrixOfValues();
            var rowlength = result.RowCount;
            var columns   = result.ColumnCount;
            var length    = curve.GetPointList().Count - 1;

            for (int i = 0; i < length; i++)
            {
                var point = curve.GetPointList()[i];
                Debug.Print("FunctionValue : {0} X Coord : {1} Y Coord : {2}",
                            point.FunctionValue, point.Coords[0], point.Coords[1]);
                //                    Assert.AreEqual(result[i, j], point.FunctionValue);
            }
            for (int j = 0; j < columns; j++)
            {
                for (int i = 0; i < rowlength; i++)
                {
                    Assert.AreEqual(result[i, j], VMatrix[i, j]);
                    Debug.Print("Matrix : {0} i : {1} j : {2}",
                                result[i, j], i, j);
                }
                //                    Assert.AreEqual(result[i, j], point.FunctionValue);
            }
        }
示例#2
0
        TestDiscreteSurface()
        {
            IDiscreteSpace curve = new DiscreteSurface(_rows, _pointCoords, VMatrix);

            for (int i = 0; i < curve.GetPointList().Count; i++)
            {
                IPoint point = curve.GetPointList()[i];
                Console.WriteLine(point.FunctionValue);
            }
        }
示例#3
0
        TestInterpolatedSurface()
        {
            var curve       = new DiscreteSurface(_rows, _pointCoords, VMatrix);
            var interpCurve = new InterpolatedSurface(curve, new LinearInterpolation(), true);

            for (int i = 0; i < curve.GetPointList().Count; i++)
            {
                IPoint point = curve.GetPointList()[i];
                var    val   = interpCurve.Value(point);
                Console.WriteLine(point.FunctionValue);
            }
        }
示例#4
0
        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);
                }
            }
        }
示例#5
0
        TestDiscreteSurfaceFromPointList()
        {
            var pointList = new List <IPoint>();

            for (var j = 0; j < _pointCoords.Length; j++)
            {
                for (var i = 0; i < _rows.Length; i++)
                {
                    var point = new Point2D(_rows[i], _pointCoords[j], VMatrix[i, j]);
                    pointList.Add(point);
                }
            }
            IDiscreteSpace curve = new DiscreteSurface(pointList);

            for (int i = 0; i < curve.GetPointList().Count; i++)
            {
                IPoint point = curve.GetPointList()[i];
                Console.WriteLine(point.FunctionValue);
            }
        }