Example #1
0
        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));
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }