コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: Polygon2d.cs プロジェクト: JohannesMP/Essence
 /**
  * This method evaluates the area of this polygon.
  */
 public double SignedArea()
 {
     return(PolygonUtils.SignedArea(this.vertices, this.robust));
 }