Skip to content

Instantly share code, notes, and snippets.

@jorgepiloto
Created August 8, 2019 10:14
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 jorgepiloto/6383a5b67811befdc64da06aa1b5068d to your computer and use it in GitHub Desktop.
Save jorgepiloto/6383a5b67811befdc64da06aa1b5068d to your computer and use it in GitHub Desktop.
poliastro issue #751
from astropy import units as u
from poliastro.twobody.angles import nu_to_M
from poliastro.core.angles import nu_to_M as nu_to_M_core
nu = 150 * u.deg
ecc = 0.08 * u.one
# If making use of radians in high-level function
M = nu_to_M(nu.to(u.rad), ecc)
print("\nHigh level function radian input results")
print("M:", M.to(u.deg))
print("M:", M.to(u.rad))
# If making use of radians in high-level function
M = nu_to_M(nu.to(u.deg), ecc)
print("\nHigh level function degrees input results")
print("M:", M.to(u.deg))
print("M:", M.to(u.rad))
# If making use of radians in low-level function
M = nu_to_M_core(nu.to(u.rad), ecc)
print("\nLow level function radians input results")
print("M:", M)
# If making use of radians in low-level function
M = nu_to_M_core(nu.to(u.deg), ecc)
print("\nLow level function degrees input results")
print("M:", M)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment