/// <summary> /// /// </summary> /// <param name="d0"></param> /// <param name="d1"></param> /// <returns></returns> public static Domain3d Intersect(Domain3d d0, Domain3d d1) { d0.X = Domain1d.Intersect(d0.X, d1.X); d0.Y = Domain1d.Intersect(d0.Y, d1.Y); d0.Z = Domain1d.Intersect(d0.Z, d1.Z); return(d0); }
/// <summary> /// /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <returns></returns> public static Domain3d Union(Domain3d a, Domain3d b) { a.X = Domain1d.Union(a.X, b.X); a.Y = Domain1d.Union(a.Y, b.Y); a.Z = Domain1d.Union(a.Z, b.Z); return(a); }
/// <summary> /// /// </summary> /// <param name="point"></param> /// <param name="from"></param> /// <param name="to"></param> /// <returns></returns> public static Vec3d Remap(Vec3d point, Domain3d from, Domain3d to) { point.X = Domain1d.Remap(point.X, from.X, to.X); point.Y = Domain1d.Remap(point.Y, from.Y, to.Y); point.Y = Domain1d.Remap(point.Z, from.Z, to.Z); return(point); }
/// <summary> /// /// </summary> /// <param name="other"></param> public void Include(Domain3d other) { X.Include(other.X); Y.Include(other.Y); Z.Include(other.Z); }
/// <summary> /// /// </summary> /// <param name="other"></param> /// <param name="tolerance"></param> /// <returns></returns> public bool ApproxEquals(Domain3d other, double tolerance = zMath.ZeroTolerance) { return(X.ApproxEquals(other.X, tolerance) && Y.ApproxEquals(other.Y, tolerance) && Z.ApproxEquals(other.Z, tolerance)); }