Created
September 26, 2021 16:29
-
-
Save YannBerthelot/283f970affc641d116b4a67359ce6a1e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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