MCPcopy Create free account
hub / github.com/Kitware/VTK / isPointInExtent

Function isPointInExtent

ThirdParty/libproj/vtklibproj/src/grids.cpp:1420–1435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1418// ---------------------------------------------------------------------------
1419
1420static bool isPointInExtent(double x, double y, const ExtentAndRes &extent,
1421 double eps = 0) {
1422 if (!(y + eps >= extent.south && y - eps <= extent.north))
1423 return false;
1424 if (extent.fullWorldLongitude())
1425 return true;
1426 if (extent.isGeographic) {
1427 if (x + eps < extent.west)
1428 x += 2 * M_PI;
1429 else if (x - eps > extent.east)
1430 x -= 2 * M_PI;
1431 }
1432 if (!(x + eps >= extent.west && x - eps <= extent.east))
1433 return false;
1434 return true;
1435}
1436
1437// ---------------------------------------------------------------------------
1438

Callers 1

gridAtMethod · 0.85

Calls 1

fullWorldLongitudeMethod · 0.80

Tested by

no test coverage detected