Exemplo n.º 1
0
        public void DistanceToPointTest()
        {
            Box3d   b  = new Box3d();
            Point3d p1 = new Point3d(0.3, 0.4, 0.2); // Point inside box
            Point3d p2 = new Point3d(0.3, 0.4, 0.5); // Point on boundary
            Point3d p3 = new Point3d(0.3, 0.4, 1.0); // Point outside box

            Assert.IsTrue(GeometRi3D.AlmostEqual(b.DistanceTo(p1), 0.0));
            Assert.IsTrue(GeometRi3D.AlmostEqual(b.DistanceTo(p2), 0.0));
            Assert.IsTrue(GeometRi3D.AlmostEqual(b.DistanceTo(p3), 0.5));
        }
Exemplo n.º 2
0
        public void BoxDistanceToCircleTest()
        {
            Box3d    box = new Box3d();
            Circle3d c   = new Circle3d(new Point3d(-1.3195, -1.0435, -0.70047), 0.35, new Vector3d(0.83694, -0.13208, -0.53112));

            double dist = box.DistanceTo(c);

            Assert.IsTrue(dist > 0);
        }