public void AtEdge() { var p1 = new Polygon ( new[] { new Vector3(0.0, 0.0), new Vector3(10.0, 0.0), new Vector3(10.0, 10.0), new Vector3(0.0, 10.0) } ); var p2 = new Polygon ( new[] { new Vector3(5.0, 0.0), new Vector3(10.0, 0.0), new Vector3(10.0, 10.0), new Vector3(5.0, 10.0) } ); var perimeter = new Polygon ( new[] { new Vector3(0.0, 0.0), new Vector3(20.0, 0.0), new Vector3(20.0, 20.0), new Vector3(0.0, 20.0) } ); Assert.False(p1.AtEdge(perimeter)); Assert.True(p2.AtEdge(perimeter)); }