Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ----------------------------------------------------------------------------
- // setInclination(id)
- // Attempts to adjust the inclination of the current orbit to the desired angle
- // Always performs burn at apoapsis for most efficient burn. It may be wise to
- // break the full adjustment into smaller bits, or consider raising apoapsis
- // to save fuel.
- // ----------------------------------------------------------------------------
- function setInclination {
- declare parameter id. // inclination desired
- // nodeEta needs to not be using apoapsis for change point, this needs to be at an or dn.
- // which I cannot compute at this time.
- // gather infos
- local nodeEta to eta:apoapsis. // ETA to burn node
- local ApTime to nodeEta + time:seconds. // Apoapsis time
- local o to orbitat(ship, ApTime). // ship orbit
- local ii to o:inclination. // initial inclination
- local e to o:eccentricity. // eccentricity
- local w to o:argumentofperiapsis. // argument of periapsis
- local f to o:trueanomaly. // true anomoly at ETA
- local oP to o:period. // orbit period
- local n to calcMeanMotion(oP). // mean motion calclation
- local a to o:semimajoraxis. // semi major axis.
- local di to ii - id. // difference in inclination
- if di < -180 {
- set di to di + 360.
- }
- print "T+" + round(missiontime) + " di: " + di.
- local top to 2 * sin(di/2) * sqrt(1 - e*e) * cos(w + f) * n * a.
- local bottom to 1 + e * cos(f).
- local dV to top / bottom.
- print "T+" + round(missiontime) + " Result dV: " + dV.
- // TODO: Burn Direction is not worked out yet, I shoulld be burning normal
- // at the ascending node and anti-normal at decending to raise the inclination.
- // Opposite to lower it.
- local nd to node(ApTime, 0, dV, 0).
- add nd.
- executeNode(nd).
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement