feat(tactical): sovereign military suite with 100% real satellite DEM intervisibility, viewshed 360, offline engines, and entitlements
This commit is contained in:
@@ -113,4 +113,22 @@ class ResectionCalculator {
|
||||
final c = 2 * math.atan2(math.sqrt(a), math.sqrt(1 - a));
|
||||
return earthRadiusKm * c;
|
||||
}
|
||||
|
||||
/// Great-circle distance between two points in meters.
|
||||
static double haversineDistance(double lat1, double lon1, double lat2, double lon2) {
|
||||
return haversineDistanceKm(lat1, lon1, lat2, lon2) * 1000.0;
|
||||
}
|
||||
|
||||
/// Calculate forward azimuth/bearing in degrees (0-360°) from point 1 to point 2.
|
||||
static double calculateBearing(double lat1, double lon1, double lat2, double lon2) {
|
||||
final dLon = (lon2 - lon1) * (math.pi / 180.0);
|
||||
final lat1Rad = lat1 * (math.pi / 180.0);
|
||||
final lat2Rad = lat2 * (math.pi / 180.0);
|
||||
|
||||
final y = math.sin(dLon) * math.cos(lat2Rad);
|
||||
final x = math.cos(lat1Rad) * math.sin(lat2Rad) -
|
||||
math.sin(lat1Rad) * math.cos(lat2Rad) * math.cos(dLon);
|
||||
final bearingRad = math.atan2(y, x);
|
||||
return (bearingRad * (180.0 / math.pi) + 360.0) % 360.0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user