Example #1
0
        public void Sphere_GetNormalAtPoint_returns_vector_in_correct_direction()
        {
            var centre = new Point(50.0f, -12.0f, 4.2f);
            var radius = 10.0f;
            var s = new Sphere(centre, radius);

            var actual = s.GetNormalAtPoint(new Point(60.0f, -12.0f, 4.2f));

            Assert.AreEqual(new Vector(1.0f, 0.0f, 0.0f), actual);
        }
Example #2
0
        public void Sphere_GetNormalAtPoint_returns_normalised_vector()
        {
            var centre = new Point(50.0f, -12.0f, 4.2f);
            var radius = 10.0f;
            var s = new Sphere(centre, radius);

            var actual = s.GetNormalAtPoint(new Point(60.0f, -12.0f, 4.2f));

            Assert.AreEqual(1.0f, actual.Norm(), EPSILON);
        }