tethys-feature-service/node_modules/proj4/lib/common/hypot.js

9 lines
183 B
JavaScript
Raw Permalink Normal View History

2023-10-02 13:04:02 +00:00
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));
}