コード例 #1
0
        public void PolygonShapeReturnsTopSliceOfArea2()
        {
            var Points = new List <Point2D>
            {
                new Point2D(-6.0, 0),
                new Point2D(-6.0, 12.0),
                new Point2D(6.0, 12.0),
                new Point2D(6.0, 0)
            };
            var rect        = new PolygonShape(Points);
            var slicedShape = rect.GetTopSliceOfArea(17.64);

            double refValue = 1.47;
            double y        = slicedShape.YMax - slicedShape.YMin;


            double actualTolerance = EvaluateActualTolerance(y, refValue);

            Assert.LessOrEqual(actualTolerance, tolerance);
        }
コード例 #2
0
        public void PolygonShapeReturnsTopSliceOfArea1()
        {
            var Points = new List <Point2D>
            {
                new Point2D(-1, 0),
                new Point2D(-1, 4),
                new Point2D(1, 4),
                new Point2D(1, 0)
            };
            var rect        = new PolygonShape(Points);
            var slicedShape = rect.GetTopSliceOfArea(2.0);

            double refValue = 2.0;
            double A        = slicedShape.A;


            double actualTolerance = EvaluateActualTolerance(A, refValue);

            Assert.LessOrEqual(actualTolerance, tolerance);
        }