Example #1
0
        internal static void Main(string[] args)
        {
            var pointA = new Point(0, 0);
            var pointB = new Point(0, 3);
            var pointC = new Point(4, 0);

            var pointX = new Point(3, 0.5);

            var myTriangle = new Triangle(pointA, pointB, pointC);
            Console.WriteLine(myTriangle.CheckIfPointIsInTriangle(pointX));
        }
        public void CheckIfPointIsInTriangle_InsideOfTriangleTest()
        {
            var myTriangle = new Triangle(new Point(0, 0), new Point(0, 3), new Point(4, 0));

            Assert.IsTrue(myTriangle.CheckIfPointIsInTriangle(new Point(1, 1)));
        }
        public void CheckIfPointIsInTriangle_OnThridEdgeTest()
        {
            var myTriangle = new Triangle(new Point(0, 0), new Point(0, 3), new Point(4, 0));

            Assert.IsFalse(myTriangle.CheckIfPointIsInTriangle(new Point(4, 0)));
        }