The Traffic Pattern feature enables pilots to fly realistic circuit patterns around runways. The system automatically generates correct flight legs based on standard aviation procedures.
- Standard Traffic Pattern: Automatically calculates all pattern legs:
- Departure
- Crosswind (90° turn)
- Downwind (parallel to runway, opposite direction)
- Base (90° turn toward final)
- Final (approach to runway)
- Normal: 0.5 NM downwind offset, 1000 ft pattern altitude
- Medium: 0.75 NM downwind offset, 1000 ft pattern altitude
- Large: 1.0 NM downwind offset, 1200 ft pattern altitude
- Very Large: 1.5 NM downwind offset, 1500 ft pattern altitude
- Left-Hand (default): left turns
- Right-Hand: right turns (for special runway configurations)
- Navigate to an airport with runways
- Open the Runway Approach popup
- Click the PATTERN button (next to the NM dropdown)
- Choose a runway
- Configure pattern size and direction
- Green dashed polyline: the pattern path
- Labels: show individual legs (DEPARTURE, CROSSWIND, etc.)
- Navigation guidance: red navigation line from current position to pattern entry
Generation follows aviation conventions and scales with size presets:
// Distances (in NM, converted to meters)
// Pattern size presets scale BOTH lateral and longitudinal distances:
// - Normal: base distances (e.g., 0.5 NM departure extension, 0.3 NM crosswind, 0.5 NM downwind offset)
// - Medium/Large/Very Large: scale factors (1.25x, 1.5x, 2.0x) apply to
// departure extension, crosswind, downwind length, base extension, final and short-final distances
- Departure extension (scaled): 0.5 NM * sizeScale past runway end
- Crosswind turn (scaled): 0.3 NM * sizeScale
- Downwind parallel: pattern-size dependent (0.5–1.5 NM) and scaled longitudinally
- Base leg: equal to downwind lateral distance, base extension scaled
- Final approach (scaled): 0.5 NM * sizeScale from threshold
- Short final (scaled): 0.2 NM * sizeScale from threshold- Uses Haversine formula for great-circle navigation
- Accounts for earth curvature for precise placement
- Normalizes headings to correct compass values
Polyline: green dashed line for the pathPatternLabelOverlay: custom overlay for leg labels- Auto-scales labels and rendering with zoom level
- Pattern mode works alongside Runway Approach
- Both modes can be active concurrently
- Navigation combines pattern guidance with final approach guidance
- Calculates route to pattern entry point
- Distance and bearing update in real time
- Integrates with DataPad live aircraft position
The modular design allows easy additions:
- Holding Patterns: holding stacks for traffic management
- Instrument Approaches: ILS, VOR, NDB approach patterns
- Custom Patterns: user-defined pattern configurations
- Pattern Recording: record and replay flown patterns
- Multi-Aircraft Patterns: visualize multiple aircraft in the pattern
- FAA Advisory Circular AC 90-66B: "Recommended Standard Traffic Patterns for Aeronautical Operations"
- Typical pattern altitude: 1000 ft AGL (standard), 800 ft AGL (alternate)
- Pattern direction: left-hand turns (standard), right-hand when required
MapRoutePattern.kt: pattern generation and utilitiesMapViewer.kt: pattern integration and UITrafficPatternGenerator: core pattern calculation classPatternLabelOverlay: custom overlay for pattern labels
- Pattern generation: <1 ms for a standard pattern
- Overlay rendering: GPU-accelerated
- Memory footprint: ~100 KB per active pattern
- No measurable impact on frame rate when active
- Runway data must be complete (heading, length)
- Pattern requires stored runways (won't generate from ad-hoc points)
- No dynamic wind adjustment yet (planned for v2.0)
- No vertical / altitude visualization (2D display only)