예제 #1
0
 public static bool ApproxEquals(NuGenPnt3F a, NuGenPnt3F b)
 {
     return
         (Math.Abs(a._x[0] - b._x[0]) < NuGenVector.TINY_FLOAT &&
          Math.Abs(a._x[1] - b._x[1]) < NuGenVector.TINY_FLOAT &&
          Math.Abs(a._x[2] - b._x[2]) < NuGenVector.TINY_FLOAT);
 }
예제 #2
0
 public static NuGenPnt3F Max(NuGenPnt3F a, NuGenPnt3F b)
 {
     return(new NuGenPnt3F(
                Math.Max(a._x[0], b._x[0]),
                Math.Max(a._x[1], b._x[1]),
                Math.Max(a._x[2], b._x[2])
                ));
 }
예제 #3
0
        public override bool Equals(object obj)
        {
            NuGenPnt3F x = (NuGenPnt3F)obj;

            return(
                _x[0] == x._x[0] &&
                _x[1] == x._x[1] &&
                _x[2] == x._x[2]
                );
        }
예제 #4
0
 public NuGenRay3F(NuGenPnt3F p, NuGenVec3F v)
 {
     this.p = p;
     this.v = v;
 }
예제 #5
0
 public static NuGenPnt3F Max(NuGenPnt3F a, NuGenPnt3F b)
 {
     return new NuGenPnt3F(
         Math.Max(a._x[0], b._x[0]),
         Math.Max(a._x[1], b._x[1]),
         Math.Max(a._x[2], b._x[2])
         );
 }
예제 #6
0
 public static NuGenBox3F operator +(NuGenBox3F b, NuGenBox3F c)
 {
     return(new NuGenBox3F(NuGenPnt3F.Min(b.lower, c.lower), NuGenPnt3F.Max(b.upper, c.upper)));
 }
예제 #7
0
 public bool IsOnBorder(NuGenPnt3F p)
 {
     return(IsInsideOrOnBorder(p) && !IsInside(p));
 }
예제 #8
0
 public bool IsInsideOrOnBorder(NuGenPnt3F p)
 {
     return(lower <= p && upper >= p);
 }
예제 #9
0
 public NuGenSphere3F(NuGenPnt3F center, float radius)
 {
     this.center = center;
     this.radius = radius;
 }
예제 #10
0
 public NuGenRay3F(NuGenPnt3F p, NuGenVec3F v)
 {
     this.p = p;
     this.v = v;
 }
예제 #11
0
 public bool IsOnBorder(NuGenPnt3F p)
 {
     return IsInsideOrOnBorder(p) && !IsInside(p);
 }
예제 #12
0
 public bool IsInsideOrOnBorder(NuGenPnt3F p)
 {
     return lower <= p && upper >= p;
 }
예제 #13
0
 public bool IsInside(NuGenPnt3F p)
 {
     return lower < p && upper > p;
 }
예제 #14
0
 public NuGenBox3F(NuGenPnt3F lower, NuGenPnt3F upper)
 {
     this.lower = lower;
     this.upper = upper;
 }
예제 #15
0
 public NuGenSphere3F(NuGenPnt3F center, float radius)
 {
     this.center = center;
     this.radius = radius;
 }
예제 #16
0
 public NuGenTriangle3F(NuGenPnt3F a, NuGenPnt3F b, NuGenPnt3F c)
 {
     p0 = a; p1 = b; p2 = c;
 }
예제 #17
0
 public NuGenBox3F(NuGenPnt3F lower, NuGenPnt3F upper)
 {
     this.lower = lower;
     this.upper = upper;
 }
예제 #18
0
 public NuGenTriangle3F(NuGenPnt3F a, NuGenPnt3F b, NuGenPnt3F c)
 {
     p0 = a; p1 = b; p2 = c;
 }
예제 #19
0
 public bool IsInside(NuGenPnt3F p)
 {
     return(lower < p && upper > p);
 }