public void AtCorner() { 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.True(p1.AtCorner(perimeter)); Assert.False(p2.AtCorner(perimeter)); }