E6B Flight Computer
POST/api/v1/e6b/wind-triangle/calculateCommercial Pilot

Calculate Wind Triangle

Solves the wind triangle to compute true heading and ground speed.

Code Examples

curl \
  -X POST \
  -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "trueCourseDegrees": 0,
  "trueAirspeedKt": 0,
  "windDirectionDegrees": 0,
  "windSpeedKt": 0
}' \
  "https://api.preflightapi.io/api/v1/e6b/wind-triangle/calculate"

Description

Given your desired true course, true airspeed, and the wind conditions, this calculates the heading you need to fly to stay on course and your resulting ground speed.

Response Fields

  • TrueHeadingDegrees — the heading to fly (true course + wind correction angle)
  • GroundSpeedKt — your speed over the ground after accounting for wind
  • WindCorrectionAngleDegrees — the crab angle needed to stay on course (positive = correct to the right, negative = correct to the left)
  • HeadwindComponentKt — positive = headwind, negative = tailwind
  • CrosswindComponentKt — positive = from the right, negative = from the left

Wind direction is the direction the wind is blowing *from* (standard meteorological convention).

Request BodyWindTriangleRequestDto

trueCourseDegreesnumber

True course in degrees (0–360)

trueAirspeedKtnumber

True airspeed in knots (must be greater than 0)

windDirectionDegreesnumber

Wind direction in degrees (0–360)

windSpeedKtnumber

Wind speed in knots (must be ≥ 0)

Response Schema

200Returns the wind triangle solutionWindTriangleResponseDto
trueHeadingDegreesnumber

True heading in degrees (0–360), corrected for wind

groundSpeedKtnumber

Ground speed in knots

windCorrectionAngleDegreesnumber

Wind correction angle in degrees (positive = right correction, negative = left)

headwindComponentKtnumber

Headwind component in knots (positive = headwind, negative = tailwind)

crosswindComponentKtnumber

Crosswind component in knots (positive = from the right, negative = from the left)

trueCourseDegreesnumber

True course used in calculation (degrees)

trueAirspeedKtnumber

True airspeed used in calculation (knots)

windDirectionDegreesnumber

Wind direction used in calculation (degrees)

windSpeedKtnumber

Wind speed used in calculation (knots)

400The request parameters are invalid (e.g., TAS is zero or negative)ApiErrorResponse
codestring

Machine-readable error code (e.g., "AIRCRAFT_NOT_FOUND").

messagestring

Human-readable error message suitable for display.

detailsstringnullable

Additional error details (only included in development environment).

servicestringnullable

Name of the external service that failed (only included for 503 errors).

validationErrorsRecord<string, string[]>nullable

Field-level validation errors (only for validation failures).

timestampstring

UTC timestamp when the error occurred.

traceIdstringnullable

Correlation ID for tracing the request.

pathstringnullable

Request path that generated the error.

Search Documentation

Search docs, endpoints, and schemas