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))); }
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); } }
//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); } }
public Intvl(Intvl copy) { a = copy.a; b = copy.b; }
public void Set(Intvl o) { a = o.a; b = o.b; }
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); }