public static void VisualizeInNewWindow(Func <double, double> fnc, double s, double e)
        {
            var ctrl = new FunctionVisualizer();

            ctrl.Min = s;
            ctrl.Max = e;

            ctrl.TargetFunction = fnc;

            var wnd = new Window();

            wnd.Content = ctrl;
            ctrl.UpdateUi();

            wnd.ShowDialog();
        }
        /// <summary>
        /// Visualizes the specified <see cref="function"/> in speifid interval and <see cref="samplingCount"/>.
        /// </summary>
        /// <param name="function">The function to be visualized.</param>
        /// <param name="min">The minimum of interval that function should be visualized.</param>
        /// <param name="max">The maximum of interval that function should be visualized.</param>
        /// <param name="samplingCount">The sampling count in defined inerval.</param>
        /// <param name="verticalValueLabel">The vertical value label.</param>
        public static void Show(this Func <double, double> function, double min, double max, int samplingCount = 10,
                                string verticalValueLabel = null)
        {
            var ctrl = new FunctionVisualizer();

            ctrl.TargetFunction    = function;
            ctrl.Min               = min;
            ctrl.Max               = max;
            ctrl.SamplingCount     = samplingCount;
            ctrl.VerticalAxisLabel = verticalValueLabel;

            var wnd = new Window();

            wnd.Title   = string.Format(CultureInfo.CurrentCulture, "Visualizing {0}", verticalValueLabel);
            wnd.Content = ctrl;
            wnd.ShowDialog();
        }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="fnc"></param>
        /// <param name="x0">determines the minimum horizontal axis value</param>
        /// <param name="x1">determines the maximum horizontal axis value</param>
        public static void VisualizeInNewWindow(Func <double, double> fnc, double x0, double x1, int samplingCount = 10)
        {
            var ctrl = new FunctionVisualizer();

            ctrl.suspend = true;

            ctrl.Min            = x0;
            ctrl.Max            = x1;
            ctrl.SamplingCount  = samplingCount;
            ctrl.TargetFunction = fnc;

            var wnd = new Window();

            wnd.Content  = ctrl;
            ctrl.suspend = false;
            ctrl.UpdateUi();

            wnd.ShowDialog();
        }