public void TestSignedArea() { IList <Point2d> points1 = AsList(new Point2d(0, 0), new Point2d(10, 0), new Point2d(10, 10), new Point2d(0, 10)); IList <Point2d> points2 = AsList(new Point2d(0, 0), new Point2d(0, 10), new Point2d(10, 10), new Point2d(10, 0)); Assert.AreEqual(100d, PolygonUtils.SignedArea(points1), MathUtils.EPSILON); Assert.AreEqual(-100d, PolygonUtils.SignedArea(points2), MathUtils.EPSILON); }
/** * This method evaluates the area of this polygon. */ public double SignedArea() { return(PolygonUtils.SignedArea(this.vertices, this.robust)); }