fix maneuver accuracy

This commit is contained in:
Valentin Verdier 2021-12-31 00:48:10 +01:00
parent 15f1f1ed54
commit 5eaae0f63f
2 changed files with 7 additions and 7 deletions

View File

@ -12,7 +12,7 @@ global g_direction is 90.
global g_throttle is 1. global g_throttle is 1.
global g_apoapsis is 80000. global g_apoapsis is 80000.
global g_gt_angle is 10. global g_gt_angle is 10.
global g_gt_velocity is 53. global g_gt_velocity is 52.
man_launch(g_direction, g_throttle). man_launch(g_direction, g_throttle).
man_gravity_turn(g_direction, g_gt_angle, g_gt_velocity, g_apoapsis). man_gravity_turn(g_direction, g_gt_angle, g_gt_velocity, g_apoapsis).

View File

@ -5,7 +5,7 @@ global function man_get_dv {
local rp is radius + p_periapsis. local rp is radius + p_periapsis.
local ra is radius + p_apoapsis. local ra is radius + p_apoapsis.
local a is (ra + rp) / 2. local a is (ra + rp) / 2.
return sqrt(ship:body:mu * (2/rs - 1/a)). return sqrt(ship:body:mu * (2 / rs - 1 / a)).
} }
global function man_get_dv_hohmann { global function man_get_dv_hohmann {
@ -78,11 +78,11 @@ global function man_node_exec {
lock throttle to 1. lock throttle to 1.
wait until tf - time:seconds < 0.25. wait until tf - time:seconds < 0.25.
lock steering to ship:facing. lock steering to ship:facing.
lock throttle to 0.25. lock throttle to 0.1.
set dur to man_get_duration(nd:deltav:mag, 0.25). local dv is nd:deltav:mag.
set ti to time:seconds. until nd:deltav:mag > dv {
set tf to ti + dur. set dv to nd:deltav:mag.
wait until tf - time:seconds <= 0. }
lock throttle to 0. lock throttle to 0.
remove nd. remove nd.