public CartesianPoint ConvertLocalCoordinatesToGlobalCoordinates(CartesianPoint localPoint) { KeyedSquareMatrix <DegreeOfFreedom> rotationMatrix = CalculateElementRotationMatrix().Transpose(); CartesianPoint globalCoordRelativeToLocalOrigin = new CartesianPoint(rotationMatrix.Multiply(localPoint)); GeometricVector globalCoord = globalCoordRelativeToLocalOrigin.Add(this.LocalOrigin); return(new CartesianPoint(globalCoord)); }
public void Can_add_a_vector() { CartesianPoint SUT = new CartesianPoint(3, 4, 5); GeometricVector other = new GeometricVector(5, 4, -3); CartesianPoint result = SUT.Add(other); Assert.AreEqual(8, result.X); Assert.AreEqual(8, result.Y); Assert.AreEqual(2, result.Z); }