Skip to content

Commit

Permalink
Apply performance changes to the inverse formula, too
Browse files Browse the repository at this point in the history
  • Loading branch information
James-E-A committed Feb 11, 2021
1 parent c844832 commit c4a3012
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions latlon-ellipsoidal-vincenty.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ class LatLonEllipsoidal_Vincenty extends LatLonEllipsoidal {
if (iterations >= 1000) throw new EvalError('Vincenty formula failed to converge');

const uSq = cosSqα * (a*a - b*b) / (b*b);
const A = 1 + uSq/16384*(4096+uSq*(-768+uSq*(320-175*uSq)));
const B = uSq/1024 * (256+uSq*(-128+uSq*(74-47*uSq)));
const A = (((uSq*-175 + 320)*uSq - 768)*uSq + 4096)*uSq/16384 + 1;
const B = (((uSq*-47 + 74)*uSq - 128)*uSq + 256)*uSq/1024;
const Δσ = B*sinσ*(cos2σₘ+B/4*(cosσ*(-1+2*cos2σₘ*cos2σₘ)-
B/6*cos2σₘ*(-3+4*sinσ*sinσ)*(-3+4*cos2σₘ*cos2σₘ)));

Expand Down

0 comments on commit c4a3012

Please sign in to comment.