## Your ideas, projects, opinions - podcasted.

### New episodes Monday through Friday.

Our hosting is kindly provided by Josh from AnHonestHost.com. We would appreciate it if you could donate to help reduce his costs in funding the hosting. He is also accepting bitcoins to 1KsxJr9HtsdaUeU7yaV9bk9bQi21UPBtUq
Please also consider supporting the https://archive.org/donate/ who are now hosting our media files. Right now, a generous supporter will match your contributions 3-to-1. So your \$5 donation results in \$20 for the Internet Archive.

# hpr2598 :: Calculating planetary orbits in Haskell

### tuturto talks about calculating planetary orbits

<< First, < Previous, Next >, Latest >>

Hosted by tuturto on 2018-07-18 is flagged as Clean and is released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. | Comments (0)

Function signatures (it might or might not be helpful to have these at hand while listening):

• Helpers:

``````radToDeg :: Floating a => a -> a
degToRad :: Floating a => a -> a
clamp :: Float -> Float``````
• Time:

``    day :: Int -> Int -> Int -> Float -> Day Float``
• Orbital parameters:
``````    longitudeOfAscendingNode :: Orbit body center => body -> center -> Day d -> LongAscNode body center
inclinationToEcliptic :: Orbit body center => body -> center -> Day d -> InclToEcl body center
argumentOfPeriapsis :: Orbit body center => body -> center -> Day d -> ArgPeri body center
semiMajorAxis :: Orbit body center => body -> center -> Day d -> SemiMajor body center
eccentricity :: Orbit body center => body -> center -> Day d -> Ecc body center
meanAnomaly :: Orbit body center => body -> center -> Day d -> MeanAno body center``````
• Calculating location on orbital plane:
``````    eccAnomaly :: MeanAno a b -> Ecc a b -> EccAnomaly a b
trueAnomaly :: EccAnomaly a b -> Ecc a b -> TrueAnomaly a b
dist :: EccAnomaly a b -> Ecc a b -> SemiMajor a b -> Distance a b``````
• Translating between coordinate systems:
``````    toEclCoord :: TrueAnomaly a b -> Distance a b -> LongAscNode a b -> ArgPeri a b -> InclToEcl a b -> EclCoord a b
toEqCoordinates :: EclCoord body Earth -> Day Float -> EqCoord body``````