public override int GetHashCode()
 {
     return(HashCode.Combine(
                HashCode.Combine(M00.RoundToEpsilon(), M01.RoundToEpsilon(), M02.RoundToEpsilon()),
                HashCode.Combine(M10.RoundToEpsilon(), M11.RoundToEpsilon(), M12.RoundToEpsilon()),
                HashCode.Combine(M20.RoundToEpsilon(), M21.RoundToEpsilon(), M22.RoundToEpsilon())));
 }
Example #2
0
 public override string ToString()
 {
     return(M00.ToString() + "," + M01.ToString() + "," + M02.ToString() + "," + M03.ToString() + "\r\n"
            + M10.ToString() + "," + M11.ToString() + "," + M12.ToString() + "," + M13.ToString() + "\r\n"
            + M20.ToString() + "," + M21.ToString() + "," + M22.ToString() + "," + M23.ToString() + "\r\n"
            + M30.ToString() + "," + M31.ToString() + "," + M32.ToString() + "," + M33.ToString());
 }
Example #3
0
        //// ===========================================================================================================
        //// Equality Members
        //// ===========================================================================================================

        public bool Equals(Matrix2x2 other)
        {
            return(M00.IsApproximatelyEqual(other.M00) &&
                   M01.IsApproximatelyEqual(other.M01) &&
                   M10.IsApproximatelyEqual(other.M10) &&
                   M11.IsApproximatelyEqual(other.M11));
        }
Example #4
0
 public override int GetHashCode()
 {
     return(M00.GetHashCode() ^ M01.GetHashCode() ^ M02.GetHashCode() ^ M03.GetHashCode() ^
            M10.GetHashCode() ^ M11.GetHashCode() ^ M12.GetHashCode() ^ M13.GetHashCode() ^
            M20.GetHashCode() ^ M21.GetHashCode() ^ M22.GetHashCode() ^ M23.GetHashCode() ^
            M30.GetHashCode() ^ M31.GetHashCode() ^ M32.GetHashCode() ^ M33.GetHashCode());
 }
Example #5
0
        public override int GetHashCode()
        {
            // Overflow is fine, just wrap
            unchecked
            {
                int hash = 17;

                hash = hash * 29 + M00.GetHashCode();
                hash = hash * 29 + M01.GetHashCode();
                hash = hash * 29 + M02.GetHashCode();
                hash = hash * 29 + M03.GetHashCode();

                hash = hash * 29 + M10.GetHashCode();
                hash = hash * 29 + M11.GetHashCode();
                hash = hash * 29 + M12.GetHashCode();
                hash = hash * 29 + M13.GetHashCode();

                hash = hash * 29 + M20.GetHashCode();
                hash = hash * 29 + M21.GetHashCode();
                hash = hash * 29 + M22.GetHashCode();
                hash = hash * 29 + M23.GetHashCode();

                return(hash);
            }
        }
        //// ===========================================================================================================
        //// Equality Members
        //// ===========================================================================================================

        public bool Equals(Matrix3x3 other)
        {
            return(M00.IsApproximatelyEqual(other.M00) &&
                   M01.IsApproximatelyEqual(other.M01) &&
                   M02.IsApproximatelyEqual(other.M02) &&

                   M10.IsApproximatelyEqual(other.M10) &&
                   M11.IsApproximatelyEqual(other.M11) &&
                   M12.IsApproximatelyEqual(other.M12) &&

                   M20.IsApproximatelyEqual(other.M20) &&
                   M21.IsApproximatelyEqual(other.M21) &&
                   M22.IsApproximatelyEqual(other.M22));
        }
        //// ===========================================================================================================
        //// Equality Members
        //// ===========================================================================================================

        public bool Equals(Matrix4x4 other)
        {
            // Check the diagonals first to see if we can exit early for identity matrix equality.
            return(M00.IsApproximatelyEqual(other.M00) &&
                   M11.IsApproximatelyEqual(other.M11) &&
                   M22.IsApproximatelyEqual(other.M22) &&
                   M33.IsApproximatelyEqual(other.M33) &&

                   M01.IsApproximatelyEqual(other.M01) &&
                   M02.IsApproximatelyEqual(other.M02) &&
                   M03.IsApproximatelyEqual(other.M03) &&

                   M10.IsApproximatelyEqual(other.M10) &&
                   M12.IsApproximatelyEqual(other.M12) &&
                   M13.IsApproximatelyEqual(other.M13) &&

                   M20.IsApproximatelyEqual(other.M20) &&
                   M21.IsApproximatelyEqual(other.M21) &&
                   M23.IsApproximatelyEqual(other.M23) &&

                   M30.IsApproximatelyEqual(other.M30) &&
                   M31.IsApproximatelyEqual(other.M31) &&
                   M32.IsApproximatelyEqual(other.M32));
        }
Example #8
0
 /// <summary>
 /// Returns a hash code for this GRaff.Matrix.
 /// </summary>
 /// <returns>An integer value that specifies a hash value for this GRaff.Matrix.</returns>
 public override int GetHashCode()
 => GMath.HashCombine(M00.GetHashCode(), M01.GetHashCode(), M02.GetHashCode(), M10.GetHashCode(), M11.GetHashCode(), M12.GetHashCode());
Example #9
0
 0 => new S2Point(M00, M01, M02),
 1 => new S2Point(M10, M11, M12),
Example #10
0
 get => new Matrix3d(
     M00, M01, 0.0,
Example #11
0
 get => new Vector3d(M00, M11, M22);
Example #12
0
 get => new Matrix4d(
     M00, M01, M02, 0.0,
Example #13
0
 EAxis.X => new FVector(M00, M01, M02),