/api/v1/navlog/bearing-and-distanceCommercial PilotCalculate Bearing And Distance
Calculates the great-circle bearing and distance between two geographic points.
Code Examples
curl \
-X POST \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"startLatitude": 35.214,
"startLongitude": -80.9431,
"endLatitude": 36.1245,
"endLongitude": -86.6782
}' \
"https://api.preflightapi.io/api/v1/navlog/bearing-and-distance"curl \
-X POST \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"startLatitude": 35.214,
"startLongitude": -80.9431,
"endLatitude": 36.1245,
"endLongitude": -86.6782
}' \
"https://api.preflightapi.io/api/v1/navlog/bearing-and-distance"Description
Provide a start and end point as latitude/longitude in decimal degrees. The service computes:
- True Course — The initial bearing from start to end referenced to True North (0-360 degrees), computed using WGS84 geodesic (great-circle) geometry.
- Magnetic Course — The true course adjusted for local magnetic variation at the start point. This is the course you would read on a magnetic compass (0-360 degrees).
- Distance — The great-circle distance between the two points in nautical miles.
This endpoint is useful for quick point-to-point calculations without building a full navigation log. Note that this returns *course* (direction of the route), not *heading* (direction the aircraft nose points). For wind-corrected headings, use the full navigation log endpoint.
Request BodyBearingAndDistanceRequestDto
Starting point latitude in decimal degrees.
Starting point longitude in decimal degrees.
Ending point latitude in decimal degrees.
Ending point longitude in decimal degrees.
Response Schema
True course in degrees.
Magnetic course in degrees (adjusted for magnetic variation).
Great-circle distance in nautical miles.
Machine-readable error code (e.g., "AIRCRAFT_NOT_FOUND").
Human-readable error message suitable for display.
Additional error details (only included in development environment).
Name of the external service that failed (only included for 503 errors).
Field-level validation errors (only for validation failures).
UTC timestamp when the error occurred.
Correlation ID for tracing the request.
Request path that generated the error.
Machine-readable error code (e.g., "AIRCRAFT_NOT_FOUND").
Human-readable error message suitable for display.
Additional error details (only included in development environment).
Name of the external service that failed (only included for 503 errors).
Field-level validation errors (only for validation failures).
UTC timestamp when the error occurred.
Correlation ID for tracing the request.
Request path that generated the error.