  * @alias Simon1994PlanetaryPositions
  */
 class Simon1994PlanetaryPositions {
-    /*
+    
     static let sharedInstance = Simon1994PlanetaryPositions()
     
-    /* STK Comments ------------------------------------------------------
-     * This function uses constants designed to be consistent with
-     * the SPICE Toolkit from JPL version N0051 (unitim.c)
-     * M0 = 6.239996
-     * M0Dot = 1.99096871e-7 rad/s = 0.01720197 rad/d
-     * EARTH_ECC = 1.671e-2
-     * TDB_AMPL = 1.657e-3 secs
-     *--------------------------------------------------------------------*/
-    
-    //* Values taken as specified in STK Comments except: 0.01720197 rad/day = 1.99096871e-7 rad/sec
-    //* Here we use the more precise value taken from the SPICE value 1.99096871e-7 rad/sec converted to rad/day
-    //* All other constants are consistent with the SPICE implementation of the TDB conversion
-    //* except where we treat the independent time parameter to be in TT instead of TDB.
-    //* This is an approximation made to facilitate performance due to the higher prevalance of
-    //* the TT2TDB conversion over TDB2TT in order to avoid having to iterate when converting to TDB for the JPL ephemeris.
-    //* Days are used instead of seconds to provide a slight improvement in numerical precision.
-    
-    //* For more information see:
-    //* http://www.cv.nrao.edu/~rfisher/Ephemerides/times.html#TDB
-    //* ftp://ssd.jpl.nasa.gov/pub/eph/planets/ioms/ExplSupplChap8.pdf
-    
+     /* STK Comments ------------------------------------------------------
+     This function uses constants designed to be consistent with
+     the SPICE Toolkit from JPL version N0051 (unitim.c)
+     M0 = 6.239996
+     M0Dot = 1.99096871e-7 rad/s = 0.01720197 rad/d
+     EARTH_ECC = 1.671e-2
+     TDB_AMPL = 1.657e-3 secs
+     --------------------------------------------------------------------
+     
+     Values taken as specified in STK Comments except: 0.01720197 rad/day = 1.99096871e-7 rad/sec
+     Here we use the more precise value taken from the SPICE value 1.99096871e-7 rad/sec converted to rad/day
+     All other constants are consistent with the SPICE implementation of the TDB conversion
+     except where we treat the independent time parameter to be in TT instead of TDB.
+     This is an approximation made to facilitate performance due to the higher prevalance of
+     the TT2TDB conversion over TDB2TT in order to avoid having to iterate when converting to TDB for the JPL ephemeris.
+     Days are used instead of seconds to provide a slight improvement in numerical precision.
+     
+     For more information see:
+     http://www.cv.nrao.edu/~rfisher/Ephemerides/times.html#TDB
+     ftp://ssd.jpl.nasa.gov/pub/eph/planets/ioms/ExplSupplChap8.pdf
+     */
     private let epoch: JulianDate
     private let GravitationalParameterOfEarth: Double
     private let GravitationalParameterOfSun: Double

    func computeSimonMoon(date: JulianDate) -> Cartesian3 {
        let tdbDate = taiToTdb(date)
        let x = Double(tdbDate.dayNumber - epoch.dayNumber) + ((tdbDate.secondsOfDay - epoch.secondsOfDay) / TimeConstants.SecondsPerDay)
        let t = x / TimeConstants.DaysPerJulianCentury
        let t2 = t * t
        let t3 = t2 * t
        let t4 = t3 * t
        
        // Terms from section 3.4 (b.1)
        let semimajorAxis = 383397.7725 + 0.0040 * t
        let eccentricity = 0.055545526 - 0.000000016 * t
        let inclinationConstant = 5.15668983 * RadiansPerDegree
        let inclinationSecPart = -0.00008 * t + 0.02966 * t2 -
            0.000042 * t3 - 0.00000013 * t4
        let longitudeOfPerigeeConstant = 83.35324312 * RadiansPerDegree
        let longitudeOfPerigeeSecPart = 14643420.2669 * t - 38.2702 * t2 -
            0.045047 * t3 + 0.00021301 * t4
        let longitudeOfNodeConstant = 125.04455501 * RadiansPerDegree
        let longitudeOfNodeSecPart = -6967919.3631 * t + 6.3602 * t2 +
            0.007625 * t3 - 0.00003586 * t4
        let meanLongitudeConstant = 218.31664563 * RadiansPerDegree
        let meanLongitudeSecPart = 1732559343.48470 * t - 6.3910 * t2 +
            0.006588 * t3 - 0.00003169 * t4
        
        // Delaunay arguments from section 3.5 b
        let D = 297.85019547 * RadiansPerDegree + RadiansPerArcSecond *
            (1602961601.2090 * t - 6.3706 * t2 + 0.006593 * t3 - 0.00003169 * t4)
        let F = 93.27209062 * RadiansPerDegree + RadiansPerArcSecond *
            (1739527262.8478 * t - 12.7512 * t2 - 0.001037 * t3 + 0.00000417 * t4)
        let l = 134.96340251 * RadiansPerDegree + RadiansPerArcSecond *
            (1717915923.2178 * t + 31.8792 * t2 + 0.051635 * t3 - 0.00024470 * t4)
        let lprime = 357.52910918 * RadiansPerDegree + RadiansPerArcSecond *
            (129596581.0481 * t - 0.5532 * t2 + 0.000136 * t3 - 0.00001149 * t4)
        let psi = 310.17137918 * RadiansPerDegree - RadiansPerArcSecond *
            (6967051.4360 * t + 6.2068 * t2 + 0.007618 * t3 - 0.00003219 * t4)
        
        // Add terms from Table 4
        let twoD = 2.0 * D
        let fourD = 4.0 * D
        let sixD = 6.0 * D
        let twol = 2.0 * l
        let threel = 3.0 * l
        let fourl = 4.0 * l
        let twoF = 2.0 * F
        semimajorAxis += 3400.4 * cos(twoD) - 635.6 * cos(twoD - l) -
            235.6 * cos(l) + 218.1 * cos(twoD - lprime) +
            181.0 * cos(twoD + l)
        eccentricity += 0.014216 * cos(twoD - l) + 0.008551 * cos(twoD - twol) -
            0.001383 * cos(l) + 0.001356 * cos(twoD + l) -
            0.001147 * cos(fourD - threel) - 0.000914 * cos(fourD - twol) +
            0.000869 * cos(twoD - lprime - l) - 0.000627 * cos(twoD) -
            0.000394 * cos(fourD - fourl) + 0.000282 * cos(twoD - lprime - twol) -
            0.000279 * cos(D - l) - 0.000236 * cos(twol) +
            0.000231 * cos(fourD) + 0.000229 * cos(sixD - fourl) -
            0.000201 * cos(twol - twoF)
        inclinationSecPart += 486.26 * cos(twoD - twoF) - 40.13 * cos(twoD) +
            37.51 * cos(twoF) + 25.73 * cos(twol - twoF) +
            19.97 * cos(twoD - lprime - twoF)
        longitudeOfPerigeeSecPart += -55609 * sin(twoD - l) - 34711 * sin(twoD - twol) -

    func computeMoonPositionInEarthInertialFrame (date: JulianDate = JulianDate.now()) -> Cartesian3 {
        return _axesTransformation.multiplyByVector(computeSimonMoon(date))
    }
    
}
