public bool Equals(Matrix4X4 OtherMatrix, double ErrorRange) { for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { if (GetElement(i, j) < OtherMatrix.GetElement(i, j) - ErrorRange || GetElement(i, j) > OtherMatrix.GetElement(i, j) + ErrorRange) { return(false); } } } return(true); }
public void Multiply(Matrix4X4 One, Matrix4X4 Two) { if (this == One || this == Two) { throw new System.FormatException("Neither of the input parameters can be the same Matrix as this."); } for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { SetElement(i, j, 0); for (int k = 0; k < 4; k++) { AddElement(i, j, One.GetElement(i, k) * Two.GetElement(k, j)); } } } }
public void Multiply(Matrix4X4 One, Matrix4X4 Two) { if (this == One || this == Two) { throw new System.FormatException("Neither of the input parameters can be the same Matrix as this."); } for(int i = 0; i < 4; i++) { for(int j = 0; j < 4; j++) { SetElement(i, j, 0); for(int k = 0; k < 4; k++) { AddElement(i, j, One.GetElement(i, k) * Two.GetElement(k, j)); } } } }
public bool Equals(Matrix4X4 OtherMatrix, double ErrorRange) { for(int i=0; i<4; i++) { for(int j=0; j<4; j++) { if( GetElement(i, j) < OtherMatrix.GetElement(i, j) - ErrorRange || GetElement(i, j) > OtherMatrix.GetElement(i, j) + ErrorRange) { return false; } } } return true; }