{"library":"geographiclib","code":"from geographiclib.geodesic import Geodesic\n\n# Define the WGS84 ellipsoid\ngeod = Geodesic.WGS84\n\n# Solve the inverse geodesic problem (distance and azimuth between two points)\n# From Wellington, NZ (-41.32, 174.81) to Salamanca, Spain (40.96, -5.50)\ng = geod.Inverse(-41.32, 174.81, 40.96, -5.50)\nprint(f\"The distance is {g['s12']:.3f} meters.\")\n\n# Solve the direct geodesic problem (find a point at a given distance and azimuth)\n# 20000 km SW of Perth, Australia (-32.06, 115.74)\ng = geod.Direct(-32.06, 115.74, 225, 20000e3)\nprint(f\"The position is ({g['lat2']:.8f}, {g['lon2']:.8f}).\")","lang":"python","description":"This quickstart demonstrates how to use the `Geodesic` class to calculate the inverse (distance and azimuth between two points) and direct (finding a point given a starting point, azimuth, and distance) geodesic problems using the WGS84 ellipsoid.","tag":null,"tag_description":null,"last_tested":"2026-04-24","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]}