Example #1
0
 public Intvl IntersectionWith(ref Intvl o)
 {
     if (o.a > b || o.b < a)
     {
         return(Intvl.Empty);
     }
     return(new Intvl(Math.Max(a, o.a), Math.Min(b, o.b)));
 }
Example #2
0
 public double Dist(Intvl o)
 {
     if (b < o.a)
     {
         return(o.a - b);
     }
     else if (a > o.b)
     {
         return(a - o.b);
     }
     else
     {
         return(0);
     }
 }
Example #3
0
 //Ik denk dat het zo moet wrken... maybe
 public double SquaredDist(Intvl o)
 {
     if (b < o.a)
     {
         return((o.a - b) * (o.a - b));
     }
     else if (a > o.b)
     {
         return((a - o.b) * (a - o.b));
     }
     else
     {
         return(0);
     }
 }
Example #4
0
 public Intvl(Intvl copy)
 {
     a = copy.a; b = copy.b;
 }
Example #5
0
 public void Set(Intvl o)
 {
     a = o.a; b = o.b;
 }
Example #6
0
 public bool Overlaps(Intvl o)
 {
     return(!(o.a > b || o.b < a));
 }
 public Intersections(Intvl u, Intvl v)
 {
     U = u;
     V = v;
 }
 public Intersections(double u0, double u1, double v0, double v1)
 {
     U = new Intvl(u0, u1);
     V = new Intvl(v0, v1);
 }