initial commit

This commit is contained in:
Florian Zumpe
2026-06-16 10:31:41 +02:00
parent e607876d37
commit eb559b16fb
282 changed files with 3118 additions and 41422 deletions
+12
View File
@@ -0,0 +1,12 @@
(function (ns) {
'use strict';
const radians = value => value * Math.PI / 180;
ns.Distance = {
meters(a, b) {
const dLat = radians(b.lat - a.lat); const dLon = radians(b.lon - a.lon);
const h = Math.sin(dLat / 2) ** 2 + Math.cos(radians(a.lat)) * Math.cos(radians(b.lat)) * Math.sin(dLon / 2) ** 2;
return 2 * 6371000 * Math.asin(Math.sqrt(h));
},
format(meters) { return meters < 1000 ? `${Math.round(meters)} m` : `${(meters / 1000).toFixed(1)} km`; }
};
}(window.Wegwichtel));