Example #1
0
        private void button_ok_Click(object sender, EventArgs e)
        {
            if (u_x1.Text == "" || u_x2.Text == "" || u_y1.Text == "" || u_y2.Text == "")
            {
                MessageBox.Show("Please Enter All The Values For Both The Vectors");
            }
            else
            {
                vector1 = new Genetibase.MathX.NuGenStructures.NuGenPnt2D();

                vector1._x = new Double[2];

                vector1._x[0] = Double.Parse(u_x1.Text);
                vector1._x[1] = Double.Parse(u_y1.Text);


                vector2    = new Genetibase.MathX.NuGenStructures.NuGenPnt2D();
                vector2._x = new Double[2];

                vector2._x[0] = double.Parse(u_x2.Text);
                vector2._x[1] = double.Parse(u_y2.Text);


                button_add.Enabled        = true;
                button_div.Enabled        = true;
                button_equal.Enabled      = true;
                button_less_equal.Enabled = true;
                button_mul.Enabled        = true;

                button_sub.Enabled = true;
            }
        }
Example #2
0
 public static NuGenPnt2D Max(NuGenPnt2D a, NuGenPnt2D b)
 {
     return(new NuGenPnt2D(
                Math.Max(a._x[0], b._x[0]),
                Math.Max(a._x[1], b._x[1])
                ));
 }
Example #3
0
        private void button_ok_Click(object sender, EventArgs e)
        {

            if (u_x1.Text == "" || u_x2.Text == "" || u_y1.Text == "" || u_y2.Text == "")
            {
                MessageBox.Show("Please Enter All The Values For Both The Vectors");
            }
            else
            {
                vector1 = new Genetibase.MathX.NuGenStructures.NuGenPnt2D ();

                vector1._x = new Double[2];

                vector1._x[0] = Double.Parse(u_x1.Text);
                vector1._x[1] = Double.Parse(u_y1.Text);


                vector2 = new Genetibase.MathX.NuGenStructures.NuGenPnt2D ();
                vector2._x = new Double[2];

                vector2._x[0] = double.Parse(u_x2.Text);
                vector2._x[1] = double.Parse(u_y2.Text);


                button_add.Enabled = true;
                button_div.Enabled = true;
                button_equal.Enabled = true;
                button_less_equal.Enabled = true;
                button_mul.Enabled = true;

                button_sub.Enabled = true;

            }
        }
Example #4
0
        public override bool Equals(object obj)
        {
            NuGenPnt2D x = (NuGenPnt2D)obj;

            return(
                _x[0] == x._x[0] &&
                _x[1] == x._x[1]
                );
        }
Example #5
0
 public NuGenRay2D(NuGenPnt2D p, NuGenVec2D v)
 {
     this.p = p;
     this.v = v;
 }
Example #6
0
 public static NuGenBox2D operator +(NuGenBox2D b, NuGenBox2D c)
 {
     return(new NuGenBox2D(NuGenPnt2D.Min(b.lower, c.lower), NuGenPnt2D.Max(b.upper, c.upper)));
 }
Example #7
0
 public NuGenBox2D(NuGenPnt2D lower, NuGenPnt2D upper)
 {
     this.lower = lower;
     this.upper = upper;
 }
Example #8
0
 public bool IsOnBorder(NuGenPnt2D p)
 {
     return(IsInsideOrOnBorder(p) && !IsInside(p));
 }
Example #9
0
 public bool IsInsideOrOnBorder(NuGenPnt2D p)
 {
     return(lower <= p && upper >= p);
 }
Example #10
0
 public bool IsInside(NuGenPnt2D p)
 {
     return(lower < p && upper > p);
 }
Example #11
0
 public static bool ApproxEquals(NuGenPnt2D a, NuGenPnt2D b)
 {
     return
         (Math.Abs(a._x[0] - b._x[0]) < NuGenVector.TINY_DOUBLE &&
          Math.Abs(a._x[1] - b._x[1]) < NuGenVector.TINY_DOUBLE);
 }