Skip to content

Instantly share code, notes, and snippets.

@YannBerthelot
Created September 26, 2021 16:29
Show Gist options
  • Save YannBerthelot/283f970affc641d116b4a67359ce6a1e to your computer and use it in GitHub Desktop.
Save YannBerthelot/283f970affc641d116b4a67359ce6a1e to your computer and use it in GitHub Desktop.
def newton(theta, gamma, thrust, lift, drag, P, m):
cos_theta = cos(theta)
sin_theta = sin(theta)
lift_drag_thrust = np.array([lift, drag, thrust])
# Z-axis
F_z = np.sum(lift_drag_thrust * np.array([cos_theta, -sin(gamma), sin_theta])) - P
# X-axis
F_x = np.sum(lift_drag_thrust * np.array([-sin_theta, -abs(cos(gamma)), cos_theta]))
# Compute Acceleration using a = F/m
return np.array([F_x / m, F_z / m])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment