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);; }
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); }