This tool calculates the azimuth (bearing from true north) between two points (A → B). It is designed for sector scanning – radar, PTZ cameras, directional antennas, drone tracking.
🔧 Key Parameters
- Origin (A) – Latitude & longitude of the scanner / sensor.
- Target (B) – Latitude & longitude of the object to detect.
- Radius (range) – Maximum great‑circle distance from A. Beyond this radius the target is ignored (not visible).
- Angle (azimuth) – Computed direction from A to B (0°–360°, clockwise from north).
- Sector width – Defines a scan wedge, e.g., ±30° around a center bearing. Only targets within radius AND inside the angular sector are considered “detected”.
⚠️ Pitfalls – Radius & Angle
- Earth curvature & “radius” confusion: Using flat‑Earth distance distorts both range and azimuth beyond ~10 km. Always use great‑circle distance (haversine).
- Azimuth drift: On long distances, the initial bearing changes along the path. The function returns the starting bearing, not the final bearing.
- Sector edge wrap‑around errors: If sector crosses 0°/360° (e.g., from 350° to 20°), simple comparisons fail. Always normalize angles and handle circular intervals.
- Polar instability: Near the North Pole, azimuth becomes undefined – use alternative coordinate frames or reject targets within ~1° of the pole.
- Radius ≠ line‑of‑sight: A target within range may still be hidden by terrain/obstacles – this function assumes a perfect sphere without occlusion.
- Numerical precision: Very small distances (below 1 meter) produce unstable azimuth. Add a minimum distance threshold.
🔄 Sector Scanning Logic (step by step)
Imagine a radar that sweeps a fixed angular sector, e.g., from 120° to 240° (120° wide). For each target:
- Compute azimuth (α) from sensor (A) to target (B).
- Compute great‑circle distance d (radius).
- If d ≤ max_range AND α ∈ [sector_start, sector_end] → target is detected / visible.
- If sector crosses 0°/360° (e.g., 350° → 20°), use a circular condition.
Typical real‑world uses: marine radar, drone swarm tracking, wildlife monitoring, directional wireless links, camera PTZ presets.
💡 Tip for moving sensors: Recalculate azimuth and range continuously. For sweeping radar, increase sector center bearing each scan frame.
📍 Example using your coordinates:
A: 46.3586455°N, 13.4768322°E | B: 45.4857740°N, 13.7840384°E
➤ Computed azimuth A → B = 166.1° (south‑east).
If radar sector is 150° to 180°, target is visible. If sector is 0° to 90°, target is ignored.