public void BBoxIsInsideReturnsTrueForPointOnBoundary() { PointGeo p1 = new PointGeo(15, 10, -100); PointGeo p2 = new PointGeo(-15, -10, 1000); PointGeo pTestLat = new PointGeo(15, 0, 0); PointGeo pTestLat2 = new PointGeo(-15, 0, 0); PointGeo pTestLon = new PointGeo(0, 10, 0); PointGeo pTestLon2 = new PointGeo(0, -10, 0); PointGeo pTestEle = new PointGeo(0, 0, -100); PointGeo pTestEle2 = new PointGeo(0, 0, 1000); BBox target = new BBox(new IPointGeo[] { p1, p2 }); Assert.True(target.IsInside(pTestLat), "Latitude"); Assert.True(target.IsInside(pTestLon), "Longitude"); Assert.True(target.IsInside(pTestEle), "Elevation"); Assert.True(target.IsInside(pTestLat2), "Latitude"); Assert.True(target.IsInside(pTestLon2), "Longitude"); Assert.True(target.IsInside(pTestEle2), "Elevation"); }
public void BBoxIsInsideReturnsTrueIfPointIsInside() { PointGeo p1 = new PointGeo(15, 10, -100); PointGeo p2 = new PointGeo(-15, -10, 1000); PointGeo pTest = new PointGeo(0, 0, 0); BBox target = new BBox(new IPointGeo[] { p1, p2 }); Assert.True(target.IsInside(pTest)); }
public void BBoxIsInsideReturnsFalseIfPointIsOutside() { PointGeo p1 = new PointGeo(15, 10, -100); PointGeo p2 = new PointGeo(-15, -10, 1000); PointGeo pTestLat = new PointGeo(30, 0, 0); PointGeo pTestLon = new PointGeo(0, 30, 0); PointGeo pTestEle = new PointGeo(30, 0, 5000); BBox target = new BBox(new IPointGeo[] { p1, p2 }); Assert.False(target.IsInside(pTestLat), "Latitude"); Assert.False(target.IsInside(pTestLon), "Longitude"); Assert.False(target.IsInside(pTestEle), "Elevation"); }