Beispiel #1
0
        public PointF Get(PointF[] dataPoints, float f, int N)
        {
            var t = 0.0;
            var convertedPoints = dataPoints.Select(item => new Tuple <double, PointD>(++t, new PointD(item.X, item.Y))).ToList();

            _parametricGaussInterpolation = InterpolationsMetodsFactory.CreateParametricGaussInterpolation(convertedPoints);

            var max  = convertedPoints.Max(item => item.Item1);
            var maxT = ((max - 1.0) * f) / N + 1;         // f / (N / max) ;

            var point = _parametricGaussInterpolation.F(maxT);

            return(new PointF((float)point.X, (float)point.Y));
        }
Beispiel #2
0
        /// <summary>
        /// Обновить точки для отрисовки.
        /// </summary>
        public void Invalidate()
        {
            DrawingPoints = new PointF[DravingPointsNumber + 1];

            var t = 0.0;
            var convertedPoints = _dataPoints.Select(item => new Tuple <double, PointD>(++t, new PointD(item.X, item.Y))).ToList();

            _parametricGaussInterpolation = InterpolationsMetodsFactory.CreateParametricGaussInterpolation(convertedPoints);

            var max = convertedPoints.Max(item => item.Item1);


            for (var i = 0; i <= DravingPointsNumber; i++)
            {
                var maxT  = ((max - 1.0) * i) / DravingPointsNumber + 1;
                var point = _parametricGaussInterpolation.F(maxT);

                DrawingPoints[i] = new PointF((float)point.X, (float)point.Y);
            }
        }