Ejemplo n.º 1
0
        public void Triangle_GetNormalAtPoint_returns_normalised_vector()
        {
            var p1 = new Point(0.0f, 0.0f, 0.0f);
            var p2 = new Point(1.0f, 0.0f, 0.0f);
            var p3 = new Point(1.0f, 1.0f, 0.0f);
            var t = new Triangle(p1, p2, p3);

            var actual = t.GetNormalAtPoint(new Point(0.5f, 0.5f, 0.0f));

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