Exemple #1
0
        public override object Clone()
        {
            RealVector3d v = new RealVector3d(this.Name);

            v.X = this.X;
            v.Y = this.Y;
            v.Z = this.Z;
            return(v);
        }
Exemple #2
0
        public override bool Equals(object obj)
        {
            // Check the object is not null and is of type RealVector3d.
            if (obj != null && obj.GetType() == typeof(RealVector3d))
            {
                // Cast it to a RealVector3d object.
                RealVector3d vec = (RealVector3d)obj;

                // Check that the X, Y, and Z coords match
                if (this.X.Equals(vec.X) == true && this.Y.Equals(vec.Y) == true &&
                    this.Z.Equals(vec.Z) == true)
                {
                    return(true);
                }
            }

            // The objects do not match.
            return(false);
        }