Skip to content

Commit

Permalink
Merge pull request #458 from proj4js/hypot
Browse files Browse the repository at this point in the history
Use existing hypot function in sterea
  • Loading branch information
ahocevar committed Jan 9, 2024
2 parents d94b15d + 840f9b2 commit ea47b43
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/projections/sterea.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import gauss from './gauss';
import adjust_lon from '../common/adjust_lon';
import hypot from '../common/hypot';

export function init() {
gauss.init.apply(this);
Expand Down Expand Up @@ -36,7 +37,7 @@ export function inverse(p) {

p.x /= this.k0;
p.y /= this.k0;
if ((rho = Math.sqrt(p.x * p.x + p.y * p.y))) {
if ((rho = hypot(p.x, p.y))) {
var c = 2 * Math.atan2(rho, this.R2);
sinc = Math.sin(c);
cosc = Math.cos(c);
Expand Down

0 comments on commit ea47b43

Please sign in to comment.