         meanLongitudeSecPart += -3332.9 * sin(twoD) + 1197.4 * sin(twoD - l) -
             662.5 * sin(lprime) + 396.3 * sin(l) -
             218.0 * sin(twoD - lprime)
-        
+ 
         // Add terms from Table 5
-        let twoPsi = 2.0 * psi
-        let threePsi = 3.0 * psi
+        let twoPsi: Double = 2.0 * psi
+        let threePsi: Double = 3.0 * psi
         inclinationSecPart += 46.997 * cos(psi) * t - 0.614 * cos(twoD - twoF + psi) * t +
             0.614 * cos(twoD - twoF - psi) * t - 0.0297 * cos(twoPsi) * t2 -
             0.0335 * cos(psi) * t2 + 0.0012 * cos(twoD - twoF + twoPsi) * t2 -
             0.00016 * cos(psi) * t3 + 0.00004 * cos(threePsi) * t3 +
             0.00004 * cos(twoPsi) * t3
-        let perigeeAndMean = 2.116 * sin(psi) * t - 0.111 * sin(twoD - twoF - psi) * t -
+        let perigeeAndMean: Double = 2.116 * sin(psi) * t - 0.111 * sin(twoD - twoF - psi) * t -
             0.0015 * sin(psi) * t2
         longitudeOfPerigeeSecPart += perigeeAndMean
         meanLongitudeSecPart += perigeeAndMean

        
        return result
    }
    
    private func elementsToCartesian(semimajorAxis semimajorAxis: Double, eccentricity: Double, inclination: Double, longitudeOfPerigee: Double, longitudeOfNode: Double, meanLongitude: Double, gravitationalParameter: Double) -> Cartesian3 {
        
        var inclination = inclination

 * @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
     */
    private let epoch: JulianDate
    private let GravitationalParameterOfEarth: Double
    private let GravitationalParameterOfSun: Double
