예제 #1
0
        public void WidenedPolygonHasFourCorners()
        {
            Point p1 = new Point(1.234, -3.456);
            Point p2 = new Point(34, 456);
            var   lw = new LineWidener(p1, p2);

            Polygon p = lw.Widen(1.0);

            Assert.AreEqual(4, p.Vertices.Count);;
        }
예제 #2
0
        public void WidenedPolygonHasCorrectWidth()
        {
            Point p1 = new Point(1.234, -3.456);
            Point p2 = new Point(34, 456);
            var   lw = new LineWidener(p1, p2);

            Polygon p = lw.Widen(1.0);

            Assert.AreEqual(1.0, p.Vertices[0].Distance(p.Vertices[3]), 1e-6);
            Assert.AreEqual(1.0, p.Vertices[1].Distance(p.Vertices[2]), 1e-6);
        }