Пример #1
0
        public Dictionary<ICurvePointList, DrawType> sampleCurvePoints()
        {
            OrderedCurvePointList list = new OrderedCurvePointList();
            Dictionary<ICurvePointList, DrawType> result = new Dictionary<ICurvePointList, DrawType>();
            int count = curveParam.Count;
            ICurveInterpolatedData data;
            IntervalPolynomialCurveElement curve;

            if (curveParam.PolynomialCurveType == PolynomialCurveType.Newton)
            {
                data = new NewtonPolynomialCurveInterpolatedData(curveParam);
                curve = ((NewtonPolynomialCurveInterpolatedData)data).Curve;
                list.Label = "[NP]";
            }
            else if (curveParam.PolynomialCurveType == PolynomialCurveType.Lagrange)
            {
                data = new LagarangePolynomialCurveInterpolatedData(curveParam);
                curve = ((LagarangePolynomialCurveInterpolatedData)data).Curve;
                list.Label = "[LP]";
            }
            else
            {
                throw new Exception("Wrong polynomial interpolated algorithm!");
            }
            list.AddRange(sampleAPolynomialCurve(curve, count * 50));
            list.Add(data.getLastPoint());
            list.PaneCurveType = PaneCurveType.realCurve;
            result.Add(list, DrawType.LineNoDot);
            return result;
        }
 public CubicSplineInterpolationCurveParam(List<DataPoint> points, CSIBorderConditionType curveType, DoubleExtension val1, DoubleExtension val2)
 {
     pointList = new OrderedCurvePointList(points);
     csiConditionType = curveType;
     leftVal = val1;
     rightVal = val2;
     interval = new PiecewiseDataInterval(pointList);
 }
 public NewtonIntervalPolynomialCurveElement(OrderedCurvePointList pointList)
 {
     if (degree >= 0)
     {
         this.degree = pointList.Count;
         UpdateCoefficients(pointList);
     }
     list = pointList;
     this.interval = new DataInterval(list.LeftBorderPoint.X, list.RightBorderPoint.X);
 }
 public NewtonPolynomialCurveInterpolatedData(PolynomialCurveParam curveParam)
 {
     this.pointList = curveParam.PointList;
     this.newtonCurve = new NewtonIntervalPolynomialCurveElement(pointList);
 }
Пример #5
0
 public PolynomialCurveParam(List<DataPoint> points, PolynomialCurveType curveType)
 {
     pointList = new OrderedCurvePointList(points);
     this.curveType = curveType;
 }
 private NewtonIntervalPolynomialCurveElement()
 {
     this.degree = 0;
     this.list = new OrderedCurvePointList();
     this.interval = DataInterval.NullDataInterval;
 }