Пример #1
0
 private void button4_Click(object sender, EventArgs e)
 {
     if (this.uC_Parabola1.IsValid())
     {
         var a = this.uC_Parabola1.A;
         var b = this.uC_Parabola1.B;
         var c = this.uC_Parabola1.C;
         //判断方程的参数,是否有效
         ParabolicEquation parabolic = new ParabolicEquation()
         {
             A = a, B = b, C = c
         };
         if (!parabolic.IsValid())
         {
             MessageBox.Show("输入的方程参数无效");
             return;
         }
         if (!this.axisControl1.CheckParabolicIsValid(parabolic))
         {
             MessageBox.Show("输入的方程不在坐标轴内");
             return;
         }
         bool flag = this.axisControl1.GenerateParabolic(parabolic);
         if (!flag)
         {
             MessageBox.Show("生成抛物线失败");
             return;
         }
     }
 }
Пример #2
0
 private async void button7_Click(object sender, EventArgs e)
 {
     if (this.uC_Parabola1.IsValid())
     {
         var a = this.uC_Parabola1.A;
         var b = this.uC_Parabola1.B;
         var c = this.uC_Parabola1.C;
         //判断方程的参数,是否有效
         ParabolicEquation parabolic = new ParabolicEquation()
         {
             A = a, B = b, C = c
         };
         if (!parabolic.IsValid())
         {
             MessageBox.Show("输入的方程参数无效");
             return;
         }
         if (!this.axisControl1.CheckParabolicIsValid(parabolic))
         {
             MessageBox.Show("输入的方程不在坐标轴内");
             return;
         }
         List <PointF> lstPoints = this.axisControl1.GetPointFromEquation(parabolic);
         foreach (var ele in lstPoints)
         {
             axisControl1.GeneratePoint(ele);
             await Task.Delay(500);
         }
     }
 }