示例#1
0
 public Boolean Equals(Size3D size)
 {
     return(_hasValue == size._hasValue &&
            Width.Equals(size.Width) &&
            Height.Equals(size.Height) &&
            Depth.Equals(size.Depth));
 }
示例#2
0
        public void DotProduct()
        {
            IVector <DoubleComponent> Test1 = MatrixFactory <DoubleComponent> .CreateVector3D(10, 1, 2);

            IVector <DoubleComponent> Test2 = MatrixFactory <DoubleComponent> .CreateVector3D(1, 0, 0);

            DoubleComponent DotResult = Test2.Dot(Test1);

            Assert.IsTrue(DotResult.Equals(10));
        }
示例#3
0
        /// <summary>
        /// Computes whether the <see cref="Matrix2D"/> instance
        /// is equal to some <paramref name="other"/>.
        /// </summary>
        /// <param name="other">
        /// The other <see cref="Matrix2D"/> to test for equality.
        /// </param>
        /// <returns>
        /// <see langword="true"/> if they are equal; <see langword="false"/> otherwise.
        /// </returns>
        public Boolean Equals(Matrix2D other)
        {
            if (ReferenceEquals(other, null))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            Int32 length = _elements.Length;

            DoubleComponent[] x = _elements;
            DoubleComponent[] y = other._elements;

            for (Int32 i = 0; i < length; i += 3)
            {
                DoubleComponent x1 = x[i];
                DoubleComponent y1 = y[i];

                DoubleComponent x2 = x[i + 1];
                DoubleComponent y2 = y[i + 1];

                DoubleComponent x3 = x[i + 2];
                DoubleComponent y3 = y[i + 2];

                if (!x1.Equals(y1) || !x2.Equals(y2) || !x3.Equals(y3))
                {
                    return(false);
                }
            }

            return(true);
        }
示例#4
0
文件: Size2D.cs 项目: ntj/GravurGIS
 public Boolean Equals(Size2D size)
 {
     return(_width.Equals(size._width) &&
            _height.Equals(size._height) &&
            IsEmpty == size.IsEmpty);
 }
示例#5
0
文件: Point2D.cs 项目: ntj/GravurGIS
 public Boolean Equals(Point2D point)
 {
     return(_x.Equals(point._x) &&
            _y.Equals(point._y) &&
            IsEmpty == point.IsEmpty);
 }