public bool Equals(GenericPosition3D <T> p)
 {
     return
         (EqualityComparer <T> .Default.Equals(x, p.x) &&
          EqualityComparer <T> .Default.Equals(y, p.y) &&
          EqualityComparer <T> .Default.Equals(z, p.z));
 }
 public T ManhattanDistance(GenericPosition3D <T> p = new GenericPosition3D <T>())
 {
     return(Extensions.Add(
                Extensions.Abs(Extensions.Subtract(x, p.x)),
                Extensions.Abs(Extensions.Subtract(y, p.y)),
                Extensions.Abs(Extensions.Subtract(z, p.z))
                ));
 }
        public static GenericPosition3D <T> operator /(GenericPosition3D <T> p1, T k)
        {
            GenericPosition3D <T> p = new GenericPosition3D <T>(p1);

            p.x = Extensions.Divide(p.x, k);
            p.y = Extensions.Divide(p.y, k);
            p.z = Extensions.Divide(p.z, k);
            return(p);
        }
        public static GenericPosition3D <T> operator *(GenericPosition3D <T> p1, GenericPosition3D <T> p2)
        {
            GenericPosition3D <T> p = new GenericPosition3D <T>(p1);

            p.x = Extensions.Multiply(p.x, p2.x);
            p.y = Extensions.Multiply(p.y, p2.y);
            p.z = Extensions.Multiply(p.z, p2.z);
            return(p);
        }
 public int CompareTo(GenericPosition3D <T> p)
 {
     if (!EqualityComparer <T> .Default.Equals(z, p.z))
     {
         return(Comparer <T> .Default.Compare(z, p.z));
     }
     else if (!EqualityComparer <T> .Default.Equals(y, p.y))
     {
         return(Comparer <T> .Default.Compare(y, p.y));
     }
     else
     {
         return(Comparer <T> .Default.Compare(x, p.x));
     }
 }
 public GenericPosition3D(GenericPosition3D <T> p)
 {
     x = p.x;
     y = p.y;
     z = p.z;
 }