proj4js/lib/common/hypot.js
2025-04-29 20:22:09 +02:00

9 lines
184 B
JavaScript

export default function (x, y) {
x = Math.abs(x);
y = Math.abs(y);
var a = Math.max(x, y);
var b = Math.min(x, y) / (a ? a : 1);
return a * Math.sqrt(1 + Math.pow(b, 2));
}