Skip to content

Instantly share code, notes, and snippets.

@vsmelov
Created May 31, 2021 12:51
Show Gist options
  • Save vsmelov/59fb49c434a1a0dae5c21618fb78c3e5 to your computer and use it in GitHub Desktop.
Save vsmelov/59fb49c434a1a0dae5c21618fb78c3e5 to your computer and use it in GitHub Desktop.
distances to space objects
from django.shortcuts import render
# def get_auctions
KM = 1000
earth = 12742*KM
sun = 1.4 * 10**6 * KM
sun_dist = 150 * 10**6 * KM
space_year_ = 300_000 * 24 * 3600 * 365
space_year = 9_460_730_472_580_800
print(f'{space_year_=}')
print(f'{space_year=}')
star_dist = 4 * space_year
galaxy_center_dist = 27_000 * space_year
# earth_want = 1
sun_want = 0.1
# scale = earth_want/earth
scale = sun_want/sun
earth_scaled = earth * scale
sun_scaled = sun * scale
sun_dist_scaled = sun_dist * scale
star_dist_scaled = star_dist * scale
galaxy_center_dist_scaled = galaxy_center_dist * scale
print(f'{earth_scaled=}')
print(f'{sun_scaled=}')
print(f'{sun_dist_scaled=}')
print(f'{star_dist_scaled=}')
print(f'{galaxy_center_dist_scaled=}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment