public static RtTuple Subtract(RtTuple a, RtTuple b) { return(new RtTuple(a.X - b.X, a.Y - b.Y, a.Z - b.Z, a.W - b.W)); }
public RtTuple Add(RtTuple addTuple) { return(new RtTuple(this.X + addTuple.X, this.Y + addTuple.Y, this.Z + addTuple.Z, this.W + addTuple.W)); }
public RtTuple Multiply(RtTuple tuple) { var result = new double[RowCount]; var tupleValues = tuple.AsArray(); for (var row = 0; row < this.RowCount; row++) { double rowValue = 0; for (var col = 0; col < this.ColCount; col++) { rowValue += Get(row, col) * tupleValues[col]; } result[row] = rowValue; } return(new RtTuple(result[0], result[1], result[2], result[3])); }
public RtTuple Negate() { var zeroTuple = new RtTuple(0, 0, 0, 0); return(zeroTuple.Subtract(this)); }
public RtTuple Subtract(RtTuple subTuple) { return(Subtract(this, subTuple)); }
public RtTuple Cross(RtTuple other) { return(new Vector(Y * other.Z - Z * other.Y, Z * other.X - X * other.Z, X * other.Y - Y * other.X)); }
public double Dot(RtTuple other) { return((X * other.X) + (Y * other.Y) + (Z * other.Z) + (W * other.W)); }