Skip to content

Commit

Permalink
geocentric_radius(): save a sqrt()
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Mar 16, 2024
1 parent 36da998 commit 2d22cf6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/conversions/cart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,9 @@ static double geocentric_radius(double a, double b_div_a, double cosphi,
const double b_div_a_squared = b_div_a * b_div_a;
const double b_div_a_squared_mul_sinphi_squared =
b_div_a_squared * sinphi_squared;
return a *
sqrt(cosphi_squared +
b_div_a_squared * b_div_a_squared_mul_sinphi_squared) /
sqrt(cosphi_squared + b_div_a_squared_mul_sinphi_squared);
return a * sqrt((cosphi_squared +
b_div_a_squared * b_div_a_squared_mul_sinphi_squared) /
(cosphi_squared + b_div_a_squared_mul_sinphi_squared));
}

/*********************************************************************/
Expand Down

0 comments on commit 2d22cf6

Please sign in to comment.