Skip to content

Instantly share code, notes, and snippets.

@mmuszynski
Created May 25, 2020 17:14
Show Gist options
  • Save mmuszynski/f0ed6de6966f173c9258082707fb0ae6 to your computer and use it in GitHub Desktop.
Save mmuszynski/f0ed6de6966f173c9258082707fb0ae6 to your computer and use it in GitHub Desktop.
func testTrivialPlanetPositions() {
let sun = CelestialBody(gravitationalParameter: 1, radius: 1000)
let orbit = Orbit(semiMajorAxis: 2000, eccentricity: 0, meanAnomaly: 0, inclination: 0, LAN: 0, argumentOfPeriapsis: 0, centralBody: sun)
let initialPosition = Vector3D(x: 2000, y: 0, z: 0)
XCTAssertEqual(initialPosition, orbit.cartesianPosition(atTimeFromEpoch: 0))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment