Exemplo n.º 1
0
 public void setGyroNoiseStandardDeviation(GeometricVector data)
 {
     msclPINVOKE.InertialNode_setGyroNoiseStandardDeviation(swigCPtr, GeometricVector.getCPtr(data));
     if (msclPINVOKE.SWIGPendingException.Pending)
     {
         throw msclPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemplo n.º 2
0
        public void It_can_calculate_the_yAxis_for_vertical_beam()
        {
            this.CreateFiniteElement1D(-10, 0, 0, -10, 0, 10);

            GeometricVector axisY = SUT.LocalYAxis;

            Assert.AreNotEqual(0, axisY.SumMagnitudes());
        }
Exemplo n.º 3
0
 public void setMagnetometerHardIronOffset(GeometricVector offsetVector)
 {
     msclPINVOKE.InertialNode_setMagnetometerHardIronOffset(swigCPtr, GeometricVector.getCPtr(offsetVector));
     if (msclPINVOKE.SWIGPendingException.Pending)
     {
         throw msclPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemplo n.º 4
0
 public void setHardIronOffsetProcessNoise(GeometricVector data)
 {
     msclPINVOKE.InertialNode_setHardIronOffsetProcessNoise(swigCPtr, GeometricVector.getCPtr(data));
     if (msclPINVOKE.SWIGPendingException.Pending)
     {
         throw msclPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemplo n.º 5
0
 public void setGyroBias(GeometricVector biasVector)
 {
     msclPINVOKE.InertialNode_setGyroBias(swigCPtr, GeometricVector.getCPtr(biasVector));
     if (msclPINVOKE.SWIGPendingException.Pending)
     {
         throw msclPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemplo n.º 6
0
 public void Can_be_constructed()
 {
     GeometricVector planeNormal = new GeometricVector(0, 0, 1);
     CartesianPoint pointOnPlane = new CartesianPoint(0, 0, 0);
     Plane SUT = new Plane(planeNormal, pointOnPlane);
     Assert.AreEqual(planeNormal, SUT.Normal);
     Assert.AreEqual(pointOnPlane, SUT.Point);
 }
Exemplo n.º 7
0
        public UnboundedLine(GeometricVector vectorOfLine, CartesianPoint pointOnLine)
        {
            Guard.AgainstNullArgument(vectorOfLine, "vectorOfLine");
            Guard.AgainstNullArgument(pointOnLine, "pointOnLine");

            this.Vector = vectorOfLine;
            this.PointOnLine = pointOnLine;
        }
Exemplo n.º 8
0
        public CartesianPoint ConvertGlobalCoordinatesToLocalCoordinates(CartesianPoint globalPoint)
        {
            GeometricVector localCoordRelativeToLocalOrigin = globalPoint.Subtract(this.LocalOrigin);

            KeyedSquareMatrix <DegreeOfFreedom> rotationMatrix = CalculateElementRotationMatrix();
            CartesianPoint localCoord = new CartesianPoint(rotationMatrix.Multiply(localCoordRelativeToLocalOrigin));

            return(new CartesianPoint(localCoord));
        }
Exemplo n.º 9
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));
        }
Exemplo n.º 10
0
        public void Can_determine_if_equal()
        {
            GeometricVector SUT = new GeometricVector(3, 4, 5);
            GeometricVector equal = new GeometricVector(3, 4, 5);
            GeometricVector unequal = new GeometricVector(4, 5, 6);

            Assert.IsTrue(SUT.Equals(equal));
            Assert.IsFalse(SUT.Equals(unequal));
        }
Exemplo n.º 11
0
        public void Can_determine_if_equal()
        {
            GeometricVector SUT     = new GeometricVector(3, 4, 5);
            GeometricVector equal   = new GeometricVector(3, 4, 5);
            GeometricVector unequal = new GeometricVector(4, 5, 6);

            Assert.IsTrue(SUT.Equals(equal));
            Assert.IsFalse(SUT.Equals(unequal));
        }
Exemplo n.º 12
0
        public void Can_be_constructed()
        {
            GeometricVector planeNormal  = new GeometricVector(0, 0, 1);
            CartesianPoint  pointOnPlane = new CartesianPoint(0, 0, 0);
            Plane           SUT          = new Plane(planeNormal, pointOnPlane);

            Assert.AreEqual(planeNormal, SUT.Normal);
            Assert.AreEqual(pointOnPlane, SUT.Point);
        }
Exemplo n.º 13
0
        public void It_can_calculate_the_xAxis()
        {
            GeometricVector result = SUT.LocalXAxis;

            Assert.AreEqual(3, result.Count);
            Assert.AreEqual(1, result[DegreeOfFreedom.X]);
            Assert.AreEqual(-1, result[DegreeOfFreedom.Y]);
            Assert.AreEqual(2, result[DegreeOfFreedom.Z]);
        }
Exemplo n.º 14
0
        public static GeometricVector VectorNED(float north, float east, float down)
        {
            GeometricVector ret = new GeometricVector(msclPINVOKE.GeometricVector_VectorNED(north, east, down), true);

            if (msclPINVOKE.SWIGPendingException.Pending)
            {
                throw msclPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemplo n.º 15
0
        public GeometricVector captureGyroBias(ushort samplingTime)
        {
            GeometricVector ret = new GeometricVector(msclPINVOKE.InertialNode_captureGyroBias(swigCPtr, samplingTime), true);

            if (msclPINVOKE.SWIGPendingException.Pending)
            {
                throw msclPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemplo n.º 16
0
        public static GeometricVector VectorECEF(float x_init, float y_init, float z_init)
        {
            GeometricVector ret = new GeometricVector(msclPINVOKE.GeometricVector_VectorECEF(x_init, y_init, z_init), true);

            if (msclPINVOKE.SWIGPendingException.Pending)
            {
                throw msclPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemplo n.º 17
0
        public GeometricVector getGyroBias()
        {
            GeometricVector ret = new GeometricVector(msclPINVOKE.InertialNode_getGyroBias(swigCPtr), true);

            if (msclPINVOKE.SWIGPendingException.Pending)
            {
                throw msclPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemplo n.º 18
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);
        }
Exemplo n.º 19
0
        public GeometricVector getMagnetometerHardIronOffset()
        {
            GeometricVector ret = new GeometricVector(msclPINVOKE.InertialNode_getMagnetometerHardIronOffset(swigCPtr), true);

            if (msclPINVOKE.SWIGPendingException.Pending)
            {
                throw msclPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemplo n.º 20
0
        public GeometricVector getAccelNoiseStandardDeviation()
        {
            GeometricVector ret = new GeometricVector(msclPINVOKE.InertialNode_getAccelNoiseStandardDeviation(swigCPtr), true);

            if (msclPINVOKE.SWIGPendingException.Pending)
            {
                throw msclPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemplo n.º 21
0
        public void Can_be_constructed()
        {
            GeometricVector SUT = new GeometricVector(3, 4, 5);
            Assert.AreEqual(3, SUT.X);
            Assert.AreEqual(4, SUT.Y);
            Assert.AreEqual(5, SUT.Z);

            Assert.AreEqual(3, SUT[DegreeOfFreedom.X]);
            Assert.AreEqual(4, SUT[DegreeOfFreedom.Y]);
            Assert.AreEqual(5, SUT[DegreeOfFreedom.Z]);
        }
Exemplo n.º 22
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);
        }
Exemplo n.º 23
0
        public void Can_determine_if_point_is_in_plane()
        {
            GeometricVector planeNormal = new GeometricVector(0, 0, 1);
            CartesianPoint pointOnPlane = new CartesianPoint(0, 0, 0);
            Plane SUT = new Plane(planeNormal, pointOnPlane);

            CartesianPoint pointInPlane = new CartesianPoint(1, 1, 0);
            CartesianPoint pointOutOfPlane = new CartesianPoint(0, 0, 1);
            Assert.IsTrue(SUT.IsInPlane(pointInPlane));
            Assert.IsFalse(SUT.IsInPlane(pointOutOfPlane));
        }
Exemplo n.º 24
0
        public void Can_calculate_vector_to_another_point()
        {
            CartesianPoint SUT   = new CartesianPoint(3, 4, 5);
            CartesianPoint other = new CartesianPoint(5, 4, 3);

            GeometricVector result = SUT.VectorTo(other);

            Assert.AreEqual(2, result.X);
            Assert.AreEqual(0, result.Y);
            Assert.AreEqual(-2, result.Z);
        }
Exemplo n.º 25
0
        public void Can_subtract_another_point()
        {
            CartesianPoint SUT   = new CartesianPoint(3, 4, 5);
            CartesianPoint other = new CartesianPoint(5, 4, 3);

            GeometricVector result = SUT.Subtract(other);

            Assert.AreEqual(-2, result.X);
            Assert.AreEqual(0, result.Y);
            Assert.AreEqual(2, result.Z);
        }
Exemplo n.º 26
0
        public void Can_be_created()
        {
            GeometricVector vectorOfLine = new GeometricVector(1, 2, 3);
            CartesianPoint pointOnLine = new CartesianPoint(3, 4, 5);
            UnboundedLine SUT = new UnboundedLine(vectorOfLine, pointOnLine);

            Assert.AreEqual(vectorOfLine, SUT.Vector);
            Assert.AreEqual(pointOnLine, SUT.PointOnLine);
            Assert.AreEqual(vectorOfLine.X, SUT.X);
            Assert.AreEqual(vectorOfLine.Y, SUT.Y);
            Assert.AreEqual(vectorOfLine.Z, SUT.Z);
        }
Exemplo n.º 27
0
        public void Can_be_constructed()
        {
            GeometricVector SUT = new GeometricVector(3, 4, 5);

            Assert.AreEqual(3, SUT.X);
            Assert.AreEqual(4, SUT.Y);
            Assert.AreEqual(5, SUT.Z);

            Assert.AreEqual(3, SUT[DegreeOfFreedom.X]);
            Assert.AreEqual(4, SUT[DegreeOfFreedom.Y]);
            Assert.AreEqual(5, SUT[DegreeOfFreedom.Z]);
        }
Exemplo n.º 28
0
        public void Can_determine_if_point_is_in_plane()
        {
            GeometricVector planeNormal  = new GeometricVector(0, 0, 1);
            CartesianPoint  pointOnPlane = new CartesianPoint(0, 0, 0);
            Plane           SUT          = new Plane(planeNormal, pointOnPlane);

            CartesianPoint pointInPlane    = new CartesianPoint(1, 1, 0);
            CartesianPoint pointOutOfPlane = new CartesianPoint(0, 0, 1);

            Assert.IsTrue(SUT.IsInPlane(pointInPlane));
            Assert.IsFalse(SUT.IsInPlane(pointOutOfPlane));
        }
Exemplo n.º 29
0
        public void Can_be_created()
        {
            GeometricVector vectorOfLine = new GeometricVector(1, 2, 3);
            CartesianPoint  pointOnLine  = new CartesianPoint(3, 4, 5);
            UnboundedLine   SUT          = new UnboundedLine(vectorOfLine, pointOnLine);

            Assert.AreEqual(vectorOfLine, SUT.Vector);
            Assert.AreEqual(pointOnLine, SUT.PointOnLine);
            Assert.AreEqual(vectorOfLine.X, SUT.X);
            Assert.AreEqual(vectorOfLine.Y, SUT.Y);
            Assert.AreEqual(vectorOfLine.Z, SUT.Z);
        }
Exemplo n.º 30
0
        public void Can_determine_if_point_is_on_line()
        {
            GeometricVector vectorOfLine = new GeometricVector(2, 2, 2);
            CartesianPoint pointOnLine = new CartesianPoint(3, 4, 5);
            UnboundedLine SUT = new UnboundedLine(vectorOfLine, pointOnLine);

            CartesianPoint aPointOnTheLine = new CartesianPoint(4, 5, 6);
            CartesianPoint aPointNotOnTheLine = new CartesianPoint(3, 5, 7);
            CartesianPoint aPointOnTheLineInNegativeDirectionFromDefinedPointOnLine = new CartesianPoint(2, 3, 4);
            Assert.IsTrue(SUT.IsOnLine(aPointOnTheLine));
            Assert.IsFalse(SUT.IsOnLine(aPointNotOnTheLine));
            Assert.IsTrue(SUT.IsOnLine(aPointOnTheLineInNegativeDirectionFromDefinedPointOnLine));
        }
Exemplo n.º 31
0
        public void Can_determine_if_point_is_on_line()
        {
            GeometricVector vectorOfLine = new GeometricVector(2, 2, 2);
            CartesianPoint  pointOnLine  = new CartesianPoint(3, 4, 5);
            UnboundedLine   SUT          = new UnboundedLine(vectorOfLine, pointOnLine);

            CartesianPoint aPointOnTheLine    = new CartesianPoint(4, 5, 6);
            CartesianPoint aPointNotOnTheLine = new CartesianPoint(3, 5, 7);
            CartesianPoint aPointOnTheLineInNegativeDirectionFromDefinedPointOnLine = new CartesianPoint(2, 3, 4);

            Assert.IsTrue(SUT.IsOnLine(aPointOnTheLine));
            Assert.IsFalse(SUT.IsOnLine(aPointNotOnTheLine));
            Assert.IsTrue(SUT.IsOnLine(aPointOnTheLineInNegativeDirectionFromDefinedPointOnLine));
        }
Exemplo n.º 32
0
        public void Can_calculate_perpendicular_line_to_a_point()
        {
            GeometricVector vectorOfLine = new GeometricVector(2, 2, 0);
            CartesianPoint pointOnLine = new CartesianPoint(3, 4, 5);
            UnboundedLine SUT = new UnboundedLine(vectorOfLine, pointOnLine);

            CartesianPoint perpendicularPoint = new CartesianPoint(3, 6, 5);
            BoundedLine result = SUT.PerpendicularLineTo(perpendicularPoint);
            Assert.AreEqual(-1, result.X);
            Assert.AreEqual(1, result.Y);
            Assert.AreEqual(0, result.Z);
            Assert.AreEqual(4, result.Start.X);
            Assert.AreEqual(5, result.Start.Y);
            Assert.AreEqual(5, result.Start.Z);
        }
Exemplo n.º 33
0
        public void Can_calculate_perpendicular_line_to_a_point()
        {
            GeometricVector vectorOfLine = new GeometricVector(2, 2, 0);
            CartesianPoint  pointOnLine  = new CartesianPoint(3, 4, 5);
            UnboundedLine   SUT          = new UnboundedLine(vectorOfLine, pointOnLine);

            CartesianPoint perpendicularPoint = new CartesianPoint(3, 6, 5);
            BoundedLine    result             = SUT.PerpendicularLineTo(perpendicularPoint);

            Assert.AreEqual(-1, result.X);
            Assert.AreEqual(1, result.Y);
            Assert.AreEqual(0, result.Z);
            Assert.AreEqual(4, result.Start.X);
            Assert.AreEqual(5, result.Start.Y);
            Assert.AreEqual(5, result.Start.Z);
        }
Exemplo n.º 34
0
        public void Can_determine_if_point_is_on_the_line()
        {
            vectorOfLine = new GeometricVector(2, 2, 2);
            startPoint   = new CartesianPoint(3, 4, 5);
            SUT          = new BoundedLine(startPoint, vectorOfLine);

            CartesianPoint pointOnTheLine     = new CartesianPoint(4, 5, 6);
            CartesianPoint pointAtEndOfLine   = new CartesianPoint(5, 6, 7);
            CartesianPoint pointAtStartOfLine = new CartesianPoint(3, 4, 5);

            CartesianPoint pointBeyondEndOfLine   = new CartesianPoint(6, 7, 8);
            CartesianPoint pointBeyondStartOfLine = new CartesianPoint(2, 3, 4);

            Assert.IsTrue(SUT.IsOnLine(pointOnTheLine));
            Assert.IsTrue(SUT.IsOnLine(pointAtEndOfLine));
            Assert.IsTrue(SUT.IsOnLine(pointAtStartOfLine));
            Assert.IsFalse(SUT.IsOnLine(pointBeyondEndOfLine));
            Assert.IsFalse(SUT.IsOnLine(pointBeyondStartOfLine));
        }
Exemplo n.º 35
0
 public BoundedLine(CartesianPoint startOfLine, GeometricVector vectorOfLineFromStartToEnd)
     : base(vectorOfLineFromStartToEnd, startOfLine)
 {
     // empty
 }
Exemplo n.º 36
0
 public void SetUp()
 {
     vectorOfLine = new GeometricVector(2, 3, 4);
     startPoint   = new CartesianPoint(3, 4, 5);
     SUT          = new BoundedLine(startPoint, vectorOfLine);
 }
Exemplo n.º 37
0
        public void Can_determine_if_point_is_on_the_line()
        {
            vectorOfLine = new GeometricVector(2, 2, 2);
            startPoint = new CartesianPoint(3, 4, 5);
            SUT = new BoundedLine(startPoint, vectorOfLine);

            CartesianPoint pointOnTheLine = new CartesianPoint(4, 5, 6);
            CartesianPoint pointAtEndOfLine = new CartesianPoint(5, 6, 7);
            CartesianPoint pointAtStartOfLine = new CartesianPoint(3, 4, 5);

            CartesianPoint pointBeyondEndOfLine = new CartesianPoint(6, 7, 8);
            CartesianPoint pointBeyondStartOfLine = new CartesianPoint(2, 3, 4);

            Assert.IsTrue(SUT.IsOnLine(pointOnTheLine));
            Assert.IsTrue(SUT.IsOnLine(pointAtEndOfLine));
            Assert.IsTrue(SUT.IsOnLine(pointAtStartOfLine));
            Assert.IsFalse(SUT.IsOnLine(pointBeyondEndOfLine));
            Assert.IsFalse(SUT.IsOnLine(pointBeyondStartOfLine));
        }
Exemplo n.º 38
0
 public void SetUp()
 {
     vectorOfLine = new GeometricVector(2, 3, 4);
     startPoint = new CartesianPoint(3, 4, 5);
     SUT = new BoundedLine(startPoint, vectorOfLine);
 }
Exemplo n.º 39
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(GeometricVector obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Exemplo n.º 40
0
 public Plane(GeometricVector planeNormal, CartesianPoint pointOnPlane)
 {
     this.Normal = planeNormal;
     this.Point = pointOnPlane;
 }