public Vector CrossProduct(Vector vector) { Vector newVector = new Vector(); newVector.SetXYZ(Y * vector.Z - Z * vector.Y, Z * vector.X - X * vector.Z, X * vector.Y - Y * vector.X); return newVector; }
public Vector PlanarRotation(double angle) { Vector rotatedVector = new Vector(); double rotMatrix11 = Math.Cos(angle); double rotMatrix12 = -Math.Sin(angle); double rotMatrix21 = Math.Sin(angle); double rotMatrix22 = Math.Cos(angle); rotatedVector.SetXYZ(X * rotMatrix11 + Y * rotMatrix12, X * rotMatrix21 + Y * rotMatrix22, 0); return rotatedVector; }
public Vector ScalarProduct(double scalar) { Vector newVector = new Vector(); newVector.SetXYZ(X * scalar, Y * scalar, Z * scalar); return newVector; }
public static Vector operator +(Vector aVector, Vector addend) { Vector newVector = new Vector(); newVector.SetXYZ(aVector.X + addend.X, aVector.Y + addend.Y, aVector.Z + addend.Z); return newVector; }