Fix circularization code.
This commit is contained in:
@ -17,13 +17,14 @@ function AddCircularizationNode {
|
||||
local n is Node(t, 0, 0, 0).
|
||||
add(n).
|
||||
|
||||
// move fast until we pass our target.
|
||||
until (usePeriapsis and n:ORBIT:APOAPSIS <= target) or n:ORBIT:PERIAPSIS >= target {
|
||||
set n:PROGRADE to n:PROGRADE + 1.
|
||||
}
|
||||
|
||||
// now bring it back in real slow until we come back.
|
||||
until (usePeriapsis and n:ORBIT:APOAPSIS > target) or n:ORBIT:PERIAPSIS < target {
|
||||
set n:PROGRADE to n:PROGRADE - 0.01.
|
||||
local delta is 1.
|
||||
local diff is n:ORBIT:APOAPSIS - n:ORBIT:PERIAPSIS.
|
||||
until (diff < 1000) {
|
||||
set n:PROGRADE to n:PROGRADE + delta.
|
||||
local newDiff is n:ORBIT:APOAPSIS - n:ORBIT:PERIAPSIS.
|
||||
if newDiff > diff {
|
||||
set delta to (delta * -1) / 10.
|
||||
}
|
||||
set diff to newDiff.
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user