Example #1
0
        public QsVector Point(double t)
        {
            var x = fx.Execute(t);
            var y = fy.Execute(t);
            var z = fz.Execute(t);

            return(new QsVector(x.ToQuantity().ToScalar(), y.ToQuantity().ToScalar(), z.ToQuantity().ToScalar()));
        }
Example #2
0
        void Sliders_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e)
        {
            Dictionary <string, double> parameters = new Dictionary <string, double>();

            Slider VariableSlider = null;

            foreach (var sl in ParametersPanel.Children)
            {
                var s = sl as Slider;

                if (s != null)
                {
                    string p = (string)s.Tag;

                    if (p.Equals(VariableTextBox.Text, StringComparison.OrdinalIgnoreCase))
                    {
                        VariableSlider = s;
                    }
                    else
                    {
                        parameters.Add(p, s.Value);
                    }
                }
            }

            // show slider
            if (VariableSlider != null)
            {
                var    step       = double.Parse(IntervalTextBox.Text);
                string vparameter = (string)VariableSlider.Tag;
                parameters.Add(vparameter, VariableSlider.Minimum);

                List <double> xl = new List <double>();
                List <double> yl = new List <double>();


                // show y=f(x)
                for (double x = VariableSlider.Minimum; x <= VariableSlider.Value; x += step)
                {
                    parameters[vparameter] = x;
                    xl.Add(x);
                    var y = CurrentExpression.Execute(parameters);
                    yl.Add(y);
                }

                lgraph.Plot(xl, yl);
            }
        }