예제 #1
0
        private void newItem_Click(object sender, System.EventArgs e)
        {
            DialogResult res = newFileDialog.ShowDialog();

            if (res == DialogResult.OK)
            {
                graph.Model          = new GraphModel();
                graph.Model.Filename = newFileDialog.FileName;
                graph.Invalidate();
                this.Text = Title + System.IO.Path.GetFileNameWithoutExtension(graph.Model.Filename);
            }
        }
예제 #2
0
        private void sinClick(object sender, System.EventArgs e)
        {
            Function1D sin = new Function1D();

            //The source represents the body of the following function:
            //double[] p, dfdp;
            //double f(double x) {
            //  ...
            //}
            sin.source = "return sin(x);";
            sin.Compile(true);
            sin.Color     = Color.Blue;
            sin.lineWidth = 2;
            graph.Model.Items.Add(sin);
            graph.Invalidate();
        }