public static NuGenBox2D operator *(NuGenBox2D b, NuGenTrafo2D t) { NuGenBox2D result = NuGenBox2D.Empty; result += b.LL * t; result += b.LU * t; result += b.UL * t; result += b.UU * t; return(result); }
//[Test] public void InitTest() { NuGenBox2D b = new NuGenBox2D(new NuGenPnt2D(1, 2), new NuGenPnt2D(4, 5)); //Assert.AreEqual(new NuGenPnt2D(1,2), b.Lower); //Assert.AreEqual(new NuGenPnt2D(4,5), b.Upper); //Assert.AreEqual(new NuGenPnt2D(1,2), b.LL); //Assert.AreEqual(new NuGenPnt2D(1,5), b.LU); //Assert.AreEqual(new NuGenPnt2D(4,2), b.UL); //Assert.AreEqual(new NuGenPnt2D(4,5), b.UU); }
public override bool Equals(object obj) { NuGenBox2D x = (NuGenBox2D)obj; return(lower == x.Lower && upper == x.Upper); }
public static bool ApproxEqual(NuGenBox2D a, NuGenBox2D b) { return (NuGenVector.ApproxEquals(a.Lower, b.Lower) && NuGenVector.ApproxEquals(a.Upper, b.Upper)); }
public bool IsOnBorder(NuGenBox2D b) { return(IsInsideOrOnBorder(b) && !IsInside(b)); }
public bool IsInsideOrOnBorder(NuGenBox2D b) { return(lower <= b.lower && upper >= b.upper); }
public bool IsInside(NuGenBox2D b) { return(lower < b.lower && upper > b.upper); }
//[Test] public void InitTest() { NuGenBox2D b = new NuGenBox2D(new NuGenPnt2D(1, 2), new NuGenPnt2D(4, 5)); //Assert.AreEqual(new NuGenPnt2D(1,2), b.Lower); //Assert.AreEqual(new NuGenPnt2D(4,5), b.Upper); //Assert.AreEqual(new NuGenPnt2D(1,2), b.LL); //Assert.AreEqual(new NuGenPnt2D(1,5), b.LU); //Assert.AreEqual(new NuGenPnt2D(4,2), b.UL); //Assert.AreEqual(new NuGenPnt2D(4,5), b.UU); }
public static bool ApproxEqual(NuGenBox2D a, NuGenBox2D b) { return NuGenVector.ApproxEquals(a.Lower, b.Lower) && NuGenVector.ApproxEquals(a.Upper, b.Upper); }
public bool IsOnBorder(NuGenBox2D b) { return IsInsideOrOnBorder(b) && !IsInside(b); }
public bool IsInsideOrOnBorder(NuGenBox2D b) { return lower <= b.lower && upper >= b.upper; }
public bool IsInside(NuGenBox2D b) { return lower < b.lower && upper > b.upper; }
private void button_ok_Click(object sender, EventArgs e) { if (Genetibase.MathX.NuGenStructures.NuGen_Structures_Main.ind == 1) { if (u_x1.Text == "" || u_x2.Text == "" || u_y1.Text == "" || u_y2.Text == "" || l_x1.Text == "" || l_x2.Text == "" || l_y1.Text == "" || l_y2.Text == "") { MessageBox.Show("Please Input All The Co-ordinates."); } else { button_add.Enabled = true; //NuGenBox2D lower_u, upper_u; box1 = new Genetibase.MathX.NuGenStructures.NuGenBox2D(); box2 = new Genetibase.MathX.NuGenStructures.NuGenBox2D(); //upper_u = new NuGenBox2D(); box1.lower = new NuGenPnt2D(); box1.lower._x = new Double[2]; box1.lower._x[0] = (double.Parse(l_x1.Text)); box1.lower._x[1] = (double.Parse(l_y1.Text)); box1.upper._x = new Double[2]; box1.upper._x[0] = (double.Parse(u_x1.Text)); box1.upper._x[1] = double.Parse(u_y1.Text); box2.lower._x = new Double[2]; box2.lower._x[0] = double.Parse(l_x2.Text); box2.lower._x[1] = double.Parse(l_y2.Text); box2.upper._x = new Double[2]; box2.upper._x[0] = double.Parse(u_x2.Text); box2.upper._x[1] = double.Parse(u_y2.Text); } } else if (Genetibase.MathX.NuGenStructures.NuGen_Structures_Main.ind == 2) { if (u_x1.Text == "" || u_x2.Text == "" || u_y1.Text == "" || u_y2.Text == "" || l_x1.Text == "" || l_x2.Text == "" || l_y1.Text == "" || l_y2.Text == "") { MessageBox.Show("Please Input All The Co-ordinates."); } else { button_add.Enabled = true; //NuGenBox2D lower_u, upper_u; box1_f = new Genetibase.MathX.NuGenStructures.NuGenBox2F(); box2_f = new Genetibase.MathX.NuGenStructures.NuGenBox2F(); //upper_u = new NuGenBox2D(); box1_f.lower = new NuGenPnt2F(); box1_f.lower._x = new float[2]; box1_f.lower._x[0] = (float.Parse(l_x1.Text)); box1_f.lower._x[1] = (float.Parse(l_y1.Text)); box1_f.upper._x = new float[2]; box1_f.upper._x[0] = (float.Parse(u_x1.Text)); box1_f.upper._x[1] = float.Parse(u_y1.Text); box2_f.lower._x = new float[2]; box2_f.lower._x[0] = float.Parse(l_x2.Text); box2_f.lower._x[1] = float.Parse(l_y2.Text); box2_f.upper._x = new float[2]; box2_f.upper._x[0] = float.Parse(u_x2.Text); box2_f.upper._x[1] = float.Parse(u_y2.Text); } } }
private void button_ok_Click(object sender, EventArgs e) { if (Genetibase.MathX.NuGenStructures.NuGen_Structures_Main.ind == 1) { if (u_x1.Text == "" || u_x2.Text == "" || u_y1.Text == "" || u_y2.Text == "" || l_x1.Text == "" || l_x2.Text == "" || l_y1.Text == "" || l_y2.Text == "") { MessageBox.Show("Please Input All The Co-ordinates."); } else { button_add.Enabled = true; //NuGenBox2D lower_u, upper_u; box1 = new Genetibase.MathX.NuGenStructures.NuGenBox2D(); box2 = new Genetibase.MathX.NuGenStructures.NuGenBox2D(); //upper_u = new NuGenBox2D(); box1.lower = new NuGenPnt2D(); box1.lower._x = new Double[2]; box1.lower._x[0] = (double.Parse(l_x1.Text)); box1.lower._x[1] = (double.Parse(l_y1.Text)); box1.upper._x = new Double[2]; box1.upper._x[0] = (double.Parse(u_x1.Text)); box1.upper._x[1] = double.Parse(u_y1.Text); box2.lower._x = new Double[2]; box2.lower._x[0] = double.Parse(l_x2.Text); box2.lower._x[1] = double.Parse(l_y2.Text); box2.upper._x = new Double[2]; box2.upper._x[0] = double.Parse(u_x2.Text); box2.upper._x[1] = double.Parse(u_y2.Text); } } else if (Genetibase.MathX.NuGenStructures.NuGen_Structures_Main.ind == 2) { if (u_x1.Text == "" || u_x2.Text == "" || u_y1.Text == "" || u_y2.Text == "" || l_x1.Text == "" || l_x2.Text == "" || l_y1.Text == "" || l_y2.Text == "") { MessageBox.Show("Please Input All The Co-ordinates."); } else { button_add.Enabled = true; //NuGenBox2D lower_u, upper_u; box1_f = new Genetibase.MathX.NuGenStructures.NuGenBox2F(); box2_f= new Genetibase.MathX.NuGenStructures.NuGenBox2F(); //upper_u = new NuGenBox2D(); box1_f.lower = new NuGenPnt2F(); box1_f.lower._x = new float[2]; box1_f.lower._x[0] = (float.Parse(l_x1.Text)); box1_f.lower._x[1] = (float.Parse(l_y1.Text)); box1_f.upper._x = new float[2]; box1_f.upper._x[0] = (float.Parse(u_x1.Text)); box1_f.upper._x[1] = float.Parse(u_y1.Text); box2_f.lower._x = new float[2]; box2_f.lower._x[0] = float.Parse(l_x2.Text); box2_f.lower._x[1] = float.Parse(l_y2.Text); box2_f.upper._x = new float[2]; box2_f.upper._x[0] = float.Parse(u_x2.Text); box2_f.upper._x[1] = float.Parse(u_y2.Text); } } }