Commit d183b813 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Revert to original square radius implementation in POLAR

parent f3ca711b
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1473,21 +1473,25 @@ void polar(
  bool onx = (y == 0.0);
  bool ony = (x == 0.0);
  bool onz = (onx && ony);
  double rhos = 0.0;
  double rho = 0.0;
  if (!onz) {
    if (!onx) {
      if (!ony) {
	rho = sqrt(x * x + y * y);
	rhos = x * x + y * y;
	rho = sqrt(rhos);
	cph = x / rho;
	sph = y / rho;
	// goes to 25
      } else { // label 20
	rhos = y * y;
	rho = (y > 0.0) ? y : -y;
	cph = 0.0;
	sph = (y > 0.0) ? 1.0 : -1.0;
	// goes to 25
      }
    } else { // label 15
      rhos = x * x;
      rho = (x > 0.0) ? x : -x;
      cph = (x > 0.0) ? 1.0 : -1.0;
      sph = 0.0;
@@ -1513,7 +1517,7 @@ void polar(
    }
  } else { // label 35
    if (!onz) {
      r = sqrt(rho * rho + z * z);
      r = sqrt(rhos + z * z);
      cth = z / r;
      sth = rho / r;
      // returns