public static Vec2 Negative(TokenType operand) { Vec2 vec = operand as Vec2; Vector.CheckNumberic(vec); return(new Vec2(FractionOperators.Negative(vec.X), FractionOperators.Negative(vec.Y))); }
public static Matrix Negative(TokenType operand) { Matrix mat = operand as Matrix; Matrix.CheckNumbericMatrix(mat); Matrix ret = Matrix.CreateUnsafeMatrix(mat.rows, mat.columns); for (int i = 0; i < ret.rows; i++) { for (int j = 0; j < ret.columns; j++) { ret.data[i, j] = FractionOperators.Negative(mat.data[i, j]); } } return(ret); }