| License | CC0 |
|---|---|
| Maintainer | frosch03@frosch03.de |
| Stability | experimental |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
System.KSP.Datatypes
Description
- data Object = Object {}
- data Celestial = Celestial {}
- data Body
- data Orbit a
- mkOrbit :: a -> Height -> Height -> Orbit a
- mkCircOrbit :: a -> Height -> Orbit a
- type Height = Double
- data System b a
- type GravConst = Double
- type KSystem = System Body
- getNextUp :: KSystem Body -> Body -> Maybe Body
- getPathUp :: KSystem Body -> Body -> [Body]
- getDivid :: KSystem Body -> Body -> Body -> (Int, Body)
- sOrbitInSystem :: Body -> KSystem Body -> Maybe (Orbit Body)
- pathOBetween :: KSystem Body -> Body -> Body -> [(Body, Orbit Body)]
- pathOBetween' :: KSystem Body -> Body -> Body -> ([(Body, Orbit Body)], (Body, Orbit Body), [(Body, Orbit Body)])
- pathBetween_ :: KSystem Body -> Body -> Body -> [Body]
- pathBetween' :: KSystem Body -> Body -> Body -> ([Body], Body, [Body])
- pathSpeeds :: [(Body, Orbit Body)] -> [Speed]
- orbitalSpeed :: Orbit Body -> Speed
Documentation
An Object is something named.
The Celestial type defines a celestial object within this
library. Every celestial object has
The Body type is the central data type within the KSP
library. It could be either Railed or Movable
Railedis everything withing ksp that is a star, a planet or a moon. They are static in their orbits and are therefore called railed.Movableis every other part in ksp, that is physical. Here they include deltaV counter, but are also modelled as celestial objects. Actually in ksp orbits around movable parts arent possible. Anyhow, within this data type such constructs are doable.
The 'Orbit a' data type defines an orbit around a central body
centerBody.
centerBodyis the body the orbit is aroundapoapsisis the height of the heighest point of the orbitperiapsisis the height of the lowest point of the orbitinclinationis the angle that the orbit is inclined against the aquatorial planeomega_bigis the longitude of the ascending nodeomega_smallis the argument of the periapsis
mkOrbit :: a -> Height -> Height -> Orbit a Source
mkOrbit takes a body as well as apoapsis and periapsis and
of that creates an orbit.
mkCircOrbit :: a -> Height -> Orbit a Source
mkCircOrbit is similar to mkOrbit with the difference that it
creates a circular orbit.
type GravConst = Double Source
GravConst is the type of the gravitation constant, which is
obious a double.
sOrbitInSystem :: Body -> KSystem Body -> Maybe (Orbit Body) Source
sOrbitInSystem takes a body, a KSystem system and maybe
returns the orbit of the body.
pathOBetween :: KSystem Body -> Body -> Body -> [(Body, Orbit Body)] Source
pathOBetween takes a KSystem system and a from Body and a
to Body. If one want's to reach the to body from from body
the bodys between and their orbit around their centerBody are
returnd.
pathOBetween' :: KSystem Body -> Body -> Body -> ([(Body, Orbit Body)], (Body, Orbit Body), [(Body, Orbit Body)]) Source
pathOBetween' takes a KSystem system and a from Body
and a to Body. If one want's to reach the to body from
from body the bodys between and their orbit around their
centerBody are returnd. They are returnd as triple, with the
overlapping body in the center of the triple and the path of the
from body in the first element of the triple. The path of the
to body in the last element of the triple.
pathBetween_ :: KSystem Body -> Body -> Body -> [Body] Source
pathBetween_ takes a KSystem system and a from Body and
a to Body. If one want's to reach the to body from
from body the bodys between are returnd, without the common
body.
pathBetween' :: KSystem Body -> Body -> Body -> ([Body], Body, [Body]) Source
pathBetween takes a KSystem system and from Body and a
to Body. If one want's to reach the to body from from
body the bodys between and their orbit around their centerBody are
returnd. They are returnd as triple, with the overlapping body in
the center of the triple and the path of the from body in the
first element of the triple. The path of the to body in the
last element of the triple.
pathSpeeds :: [(Body, Orbit Body)] -> [Speed] Source
pathSpeeds takes the result of pathOBetween and calculates the
corresponding orbital speeds.
orbitalSpeed :: Orbit Body -> Speed Source
orbitalSpeed returns the orbital velocity of the given orbit.