Skip to content

Wind aloft → true heading, ground speed, ETE & fuel per leg #666

Description

@msupino

Summary

Add per-leg (or global) wind aloft input and use it to compute the wind-correction angle (WCA), true heading, ground speed, and accurate time/fuel per leg. Today the drift lines (Show drift lines) are a static 10° cosmetic reference and the Flight Plan time/fuel assume zero wind.

Motivation

Wind is the single biggest factor in real VFR planning. Without it, ETE and fuel are optimistic and headings are wrong. This is the highest-value gap.

Proposed UI

  • Wind input in the Flight Plan modal: a global wind (dir°/kt) row, plus optional per-leg override cells.
  • New/derived columns: WCA, TH (true heading), MH (magnetic, via existing mag var), GS (ground speed). Time and Fuel recompute from GS instead of TAS.
  • Drift lines could optionally reflect the real WCA instead of a fixed angle.

Data / math

  • Standard wind triangle: WCA = asin(windSpeed * sin(windDir - course) / TAS), GS = TAS*cos(WCA) + windSpeed*cos(...).
  • TAS source = leg flightSpeed (currently treated as GS). Decide: treat existing speed as TAS.

Implementation

  • docs/app/io.js — Flight Plan table build + CSV; add wind state to route/leg model and navaid.route schema (leg.wind or global).
  • docs/app/core.js — heading/GS helpers; strings (en + he).
  • docs/app/draw.js — optional: drift line angle from WCA.
  • Persist global wind in localStorage / route JSON.

Acceptance criteria

  • Entering wind changes GS, time, fuel, and heading columns live.
  • Zero wind reproduces today's numbers.
  • Wind persists in route JSON export/import.
  • CSV includes the new columns.
  • en + he strings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions