Commit 59e1a5de authored by Jacob Kaufman's avatar Jacob Kaufman
Browse files

updated test and fixed lonTo360 latitude code

parent 79beaf39
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -103,13 +103,22 @@ export default class AstroMath {
    if (projection === "EPSG:4326") {
      convertedLon -= 180;
    }
    

    if (convertedLon < 0) {
      convertedLon += 180;
      if (projection == "EPSG:4326")
      {
        convertedLon += 360;
      }
      else
      {
        convertedLon += 180;
      }
    }
    else if (projection != "EPSG:4326")
    {
      convertedLon += 180;
    }

    return convertedLon;
  }
+2 −2
Original line number Diff line number Diff line
@@ -57,10 +57,10 @@ describe('Testing AstroMath Functions', function() {
    })

    // testing lonTo360 function
    it('Testing lonTo360 Non-Cylindrical: -180 should be 180 ', function() {
    it('Testing lonTo360 Non-Cylindrical: -180 should be 0 ', function() {
      // add an assertion
      let majorRadius = testMath.lonTo360(-180, "");
      expect(majorRadius).to.equal(180);
      expect(majorRadius).to.equal(0);
    })

    // testing domainToPositiveWest function