Пример #1
0
        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);
        }
Пример #2
0
        //[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);
        }
Пример #3
0
        public override bool Equals(object obj)
        {
            NuGenBox2D x = (NuGenBox2D)obj;

            return(lower == x.Lower && upper == x.Upper);
        }
Пример #4
0
 public static bool ApproxEqual(NuGenBox2D a, NuGenBox2D b)
 {
     return
         (NuGenVector.ApproxEquals(a.Lower, b.Lower) &&
          NuGenVector.ApproxEquals(a.Upper, b.Upper));
 }
Пример #5
0
 public bool IsOnBorder(NuGenBox2D b)
 {
     return(IsInsideOrOnBorder(b) && !IsInside(b));
 }
Пример #6
0
 public bool IsInsideOrOnBorder(NuGenBox2D b)
 {
     return(lower <= b.lower && upper >= b.upper);
 }
Пример #7
0
 public bool IsInside(NuGenBox2D b)
 {
     return(lower < b.lower && upper > b.upper);
 }
Пример #8
0
		//[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);
		}
Пример #9
0
		public static bool ApproxEqual(NuGenBox2D a, NuGenBox2D b)
		{
			return
				NuGenVector.ApproxEquals(a.Lower, b.Lower) &&
				NuGenVector.ApproxEquals(a.Upper, b.Upper);
		}
Пример #10
0
		public bool IsOnBorder(NuGenBox2D b)
		{
			return IsInsideOrOnBorder(b) && !IsInside(b);
		}
Пример #11
0
		public bool IsInsideOrOnBorder(NuGenBox2D b)
		{
			return lower <= b.lower && upper >= b.upper;
		}
Пример #12
0
		public bool IsInside(NuGenBox2D b)
		{
			return lower < b.lower && upper > b.upper;
		}