My brain just isn’t working today. I need to test whether a point (lat, long) lies within a a rectangle on a map. The rectangle is defined by it’s North, East, South, & West borders. The hiccup is that all points or values are in map-coordinate system. To deal with the date-line wrap-around, I assume that longitude is always “between” if we go from left-to-right.
bool PointInRectangle(Point pt, double North, double East, double South, double West)
{
// ????
}
Assuming east and north are positive: