Wind-adjusted fuel burn ±20% + refuel-for-flight buys 150% margin (ISS-070, ISS-071, v0.36.0)
CI / build + unit + e2e (pull_request) Successful in 10m34s
CI / build + unit + e2e (pull_request) Successful in 10m34s
This commit is contained in:
+13
@@ -1,5 +1,18 @@
|
||||
const EARTH_RADIUS_KM = 6371;
|
||||
|
||||
// Initial great-circle bearing from point 1 to point 2 (v0.36.0), degrees true [0, 360).
|
||||
export function initialBearingDeg(lat1: number, lon1: number, lat2: number, lon2: number): number {
|
||||
const toRad = (d: number) => (d * Math.PI) / 180;
|
||||
const phi1 = toRad(lat1);
|
||||
const phi2 = toRad(lat2);
|
||||
const dLon = toRad(lon2 - lon1);
|
||||
const theta = Math.atan2(
|
||||
Math.sin(dLon) * Math.cos(phi2),
|
||||
Math.cos(phi1) * Math.sin(phi2) - Math.sin(phi1) * Math.cos(phi2) * Math.cos(dLon),
|
||||
);
|
||||
return (theta * 180 / Math.PI + 360) % 360;
|
||||
}
|
||||
|
||||
// Great-circle distance between two WGS84 points (haversine), in km.
|
||||
export function haversineKm(lat1: number, lon1: number, lat2: number, lon2: number): number {
|
||||
const toRad = (d: number) => (d * Math.PI) / 180;
|
||||
|
||||
Reference in New Issue
Block a user