Skip to content

Instantly share code, notes, and snippets.

@darkbushido
Created February 11, 2017 02:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darkbushido/281e1d7ecca7cd1ec1332e6e60eef1e0 to your computer and use it in GitHub Desktop.
Save darkbushido/281e1d7ecca7cd1ec1332e6e60eef1e0 to your computer and use it in GitHub Desktop.
function landing_pos { return latlng(p["LND"]["LatLng"]:lat,p["LND"]["LatLng"]:lng). }
function R_ship { return ship:body:position. }
function angle_diff_h { return VANG(-R_ship(), landing_pos():position - R_ship()). }
function dist_diff_h { return (angle_diff_h()/360) * 2 * constant:pi()*R_ship():mag. }
function velocity_h_norm { return VCRS(VCRS(R_ship(),ship:velocity:orbit),R_ship()):normalized. }
function speed_h { return VDOT(velocity_h_norm(),ship:velocity:orbit). }
function position_speed_h { return landing_pos():altitudevelocity(altitude):orbit:mag. }
function speed_diff_h { return speed_h() - position_speed_h(). }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment