Ejemplo n.º 1
0
 public TaylorEquation(int n, double x0, Func <double, double> function)
 {
     N            = n;
     X0           = x0;
     Color        = Brushes.Black;
     TaylorSeries = new TaylorSeries(function);
     Function     = TaylorValue;
 }
Ejemplo n.º 2
0
        private void DrawTaylor_Click(object sender, RoutedEventArgs e)
        {
            CoordinatePlane.SizeX = taylorgrid.ActualWidth;
            CoordinatePlane.SizeY = taylorgrid.ActualHeight;
            Function sinFunction         = new Function("sinx");
            Func <double, double> series =
                TaylorSeries.MakeTaylorSeries(int.Parse(Number.Text), double.Parse(Point.Text), 1, 0);
            var             minspan = TaylorSeries.DetermineSinSpanMin(sinFunction.ParsedFunc, series, int.Parse(Point.Text));
            var             maxspan = TaylorSeries.DetermineSinSpanMax(sinFunction.ParsedFunc, series, int.Parse(Point.Text));
            var             diff    = maxspan - minspan;
            CoordinatePlane taylor  = new CoordinatePlane(TaylorPlane, minspan - diff / 2, -2, maxspan + diff / 2, 2);

            taylor.SetProperty();
            _taylorCoordinatePlane = taylor;
            taylor.DrawPlane();
            taylor.DrawFunction(sinFunction.ParsedFunc, Brushes.Black);
            TaylorPlane.Background = Brushes.White;
            taylor.DrawFunction(series, Brushes.PaleVioletRed);
        }