CHAPTER 15
Practice problem set
Eight worked exercises with full step-by-step solutions, covering coordinate conversions, Haversine distance, tile math, and spherical area.
Try these by hand or in code. Solutions follow. Working through problems manually is the fastest way to spot which formulas you've actually internalized versus which ones you've just read.
These problems draw on Chapters 1–13. If you get stuck, the chapter number is noted in parentheses after each problem. Don't check the solution until you've made a genuine attempt — even an incorrect one reveals where your mental model breaks down.
Problems
P1. Convert 40° 26' 46.302" N, 79° 58' 56.903" W to decimal degrees.
P2. What's the distance (Haversine) between Paris (48.8566, 2.3522) and New York (40.7128, -74.0060)?
P3. What's the initial bearing from Paris to New York?
P4. At zoom level 8, which tile contains Tokyo (35.6762, 139.6503)?
P5. A drone flies 2 km on bearing 045° from (0, 0). Where does it end up?
P6. Compute a bounding box for a 10 km radius around Karachi (24.8607, 67.0011).
P7. What's the area of a polygon with vertices (in lon, lat): (0, 0), (1, 0), (1, 1), (0, 1)? (Use the spherical formula.)
P8. A point at zoom 10 has world pixel coordinates (550000, 380000). What's its lat/lon?
Solutions
S1.
S2. Haversine:
S3.
The WNW bearing makes geographic sense: New York is almost due west of Paris, with a slight northward component visible from the non-trivial latitude difference.
S4.
Tile: (8, 227, 100)
S5.
End: (0.0127°, 0.0127°)
Equal latitude and longitude offsets make sense — at the equator, going NE means equal N and E components.
S6.
Box: lat , lon
S7. Apply the spherical polygon area formula at small scale:
Sanity check: at the equator, 1° × 1° ≈ 111 × 111 ≈ 12,321 km². Close.
Continue reading "Practice problem set"
You've reached the end of the free preview. Unlock all 22 paid chapters, including distance math, bearings, polygons, spatial indexing, and 3D map rendering — plus a downloadable PDF and the companion code repo.
- All 22 paid chapters with worked examples
- Downloadable PDF for offline reading
- Companion GitHub repo (JavaScript + Python)
- Free updates for life
Multiple payment options including Wise, PayPal, and bank transfer.
Related chapters
- Distance on a sphere — Haversine and friends — referenced in the distance exercises
- Polygons — area, centroid, and containment — referenced in the area exercises
- Web Mercator and tile math — referenced in the tile-math exercises