         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

 * @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

        let result = computeSimonMoon(date)
        return result.multiplyByScalar(_factor)
    }
 
    // Values for the <code>axesTransformation</code> needed for the rotation were found using the STK Components
    // GreographicTransformer on the position of the sun center of mass point and the earth J2000 frame.
    private let _axesTransformation = Matrix3(
        1.0000000000000002, 5.619723173785822e-16, 4.690511510146299e-19,
        -5.154129427414611e-16, 0.9174820620691819, -0.39777715593191376,
        -2.23970096136568e-16, 0.39777715593191376, 0.9174820620691819
    )
    
    /**
     * Computes the position of the Sun in the Earth-centered inertial frame
     *
