예제 #1
0
        private void Func_SelectedItemChanged(object sender, EventArgs e)
        {
            //if (Func.SelectedItem.ToString() == "y' = Sin(x)")
            //{
            //    CurrentFunction = Math.Sin;
            //    CF = "Sin(x)";
            //}
            if (Func.SelectedItem.ToString() == "y' = Sqrt(x)")
            {
                CurrentFunction = Math.Sqrt;
                CF = "Sqrt(x)";
            }
            if (Func.SelectedItem.ToString() == "y' = x^2")
            {
                CurrentFunction = x => x * x;
                CF = "x^2";
            }
            if (Func.SelectedItem.ToString() == "y' = x^4")
            {
                CurrentFunction = x => x * x * x * x;
                CF = "x^4";
            }

            //MessageBox.Show(CurrentFunction(5).ToString());
        }
예제 #2
0
파일: Form1.cs 프로젝트: KACHANIX/CompMath3
        private void Func_SelectedItemChanged(object sender, EventArgs e)
        {
            if (Func.SelectedItem.ToString() == "Sin(x)")
            {
                FirstNode.Minimum = -1000;

                Xnum.Minimum    = -1000;
                CurrentFunction = Math.Sin;
            }
            if (Func.SelectedItem.ToString() == "Sqrt(x)")
            {
                FirstNode.Minimum = 0;

                Xnum.Minimum    = 0;
                CurrentFunction = Math.Sqrt;
            }
            if (Func.SelectedItem.ToString() == "x^2")
            {
                FirstNode.Minimum = -1000;

                Xnum.Minimum    = -1000;
                CurrentFunction = x => x * x;
            }

            Fx.Text = Func.SelectedItem.ToString();

            //MessageBox.Show(CurrentFunction(5).ToString());
        }
예제 #3
0
        public Form1()
        {
            InitializeComponent();

            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            //MaximizeBox = false;
            Chart.Visible = false;


            CurrentFunction = Math.Sqrt;
            //Func.Items.Add("y' = Sin(x)");
            Func.Items.Add("y' = Sqrt(x)");
            Func.Items.Add("y' = x^2");
            //Func.Items.Add("y' = Tg(x)");
            Func.Items.Add("y' = x^4");
            Func.ReadOnly = true;

            Func.SelectedIndex = 0;

            FirstX.DecimalPlaces = 1;
            FirstX.Increment     = 0.1M;

            FirstY.DecimalPlaces = 1;
            FirstY.Increment     = 0.1M;


            LastX.DecimalPlaces = 1;
            LastX.Increment     = 0.1M;

            Precision.Value         = 0.1M;
            Precision.Minimum       = 0.1M;
            Precision.Increment     = 0.1M;
            Precision.DecimalPlaces = 1;


            FirstY.KeyPress    += new KeyPressEventHandler(Key_down);
            FirstX.KeyPress    += new KeyPressEventHandler(Key_down);
            Precision.KeyPress += new KeyPressEventHandler(Key_down);
            LastX.KeyPress     += new KeyPressEventHandler(Key_down);
        }
예제 #4
0
파일: Form1.cs 프로젝트: KACHANIX/CompMath3
        public Form1()
        {
            InitializeComponent();

            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            //MaximizeBox = false;
            Chart.Visible = false;

            Fxtb.ReadOnly      = true;
            Xnum.Minimum       = -1000;
            Xnum.DecimalPlaces = 3;


            CurrentFunction = Math.Sin;
            Func.Items.Add("Sin(x)");
            Func.Items.Add("Sqrt(x)");
            Func.Items.Add("x^2");
            Func.ReadOnly           = true;
            FirstNode.Minimum       = -1000;
            FirstNode.DecimalPlaces = 4;

            Func.SelectedIndex = 0;
            Step.DecimalPlaces = 4;
            Step.Increment     = 0.1M;
            Step.Minimum       = 0.1M;

            Steps.Value   = 20;
            Steps.Minimum = 1;
            Steps.Maximum = 10000;



            Steps.KeyPress     += new KeyPressEventHandler(Key_down);
            Step.KeyPress      += new KeyPressEventHandler(Key_down);
            FirstNode.KeyPress += new KeyPressEventHandler(Key_down);

            Fx.Text = Func.SelectedItem.ToString();
        }