public void SingleBoundingSphere()
        {
            var spheres = new List <Vector4> {
                new Vector4(0, 0, 0, 1)
            };

            var boundingSphere = BoundingSphereGenerator.GenerateBoundingSphere(spheres);

            Assert.IsTrue(SpherePointUtils.SphereContainsSpheres(boundingSphere, spheres));
        }
        public void MaxRadiusSameCenter()
        {
            var spheres = new List <Vector4> {
                new Vector4(0, 0, 0, 1), new Vector4(0, 0, 0, 2)
            };

            var boundingSphere = BoundingSphereGenerator.GenerateBoundingSphere(spheres);

            Assert.IsTrue(SpherePointUtils.SphereContainsSpheres(boundingSphere, spheres));
        }
        public void DifferentCenter3D()
        {
            var spheres = new List <Vector4>
            {
                new Vector4(1, 0, 1, 1),
                new Vector4(-1, 0, 1, 1),
                new Vector4(-1, 2, -1, 1),
                new Vector4(1, 2, -1, 1)
            };

            var boundingSphere = BoundingSphereGenerator.GenerateBoundingSphere(spheres);

            Assert.IsTrue(SpherePointUtils.SphereContainsSpheres(boundingSphere, spheres));
        }
        public void UnitCube()
        {
            var points = new List<Vector3>
            {
                new Vector3(0.5f, -0.5f, -0.5f),
                new Vector3(0.5f, -0.5f, 0.5f),
                new Vector3(-0.5f, -0.5f, 0.5f),
                new Vector3(-0.5f, -0.5f, -0.5f),
                new Vector3(0.5f, 0.5f, -0.5f),
                new Vector3(0.5f, 0.5f, 0.5f),
                new Vector3(-0.5f, 0.5f, 0.5f),
                new Vector3(-0.5f, 0.5f, -0.5f)
            };

            var boundingSphere = BoundingSphereGenerator.GenerateBoundingSphere(points);
            Assert.IsTrue(SpherePointUtils.SphereContainsPoints(boundingSphere, points));
        }