Skip to content

Instantly share code, notes, and snippets.

@YannBerthelot
Created April 24, 2021 19:30
Show Gist options
  • Save YannBerthelot/1e8edbeef50db4f48f50cfcfdabbd021 to your computer and use it in GitHub Desktop.
Save YannBerthelot/1e8edbeef50db4f48f50cfcfdabbd021 to your computer and use it in GitHub Desktop.
from numba import njit
@njit(nogil=True)
def compute_gamma(vz, norm_V):
"""
Compute gamma (the angle between ground and the speed vector) using trigonometry.
sin(gamma) = V_z / V -> gamma = arcsin(V_z/V)
"""
if norm_V > 0:
return asin(vz / norm_V)
if norm_V == 0:
return 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment