Skip to content

Commit

Permalink
Adjust to miles
Browse files Browse the repository at this point in the history
  • Loading branch information
nikdoof committed Nov 29, 2023
1 parent 82ad14a commit 8ff4ef1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion local_spaces/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def create_app():
"TEMPLATES_AUTO_RELOAD": True,
"LOCALSPACES_SPACEAPI_ENDPOINT": "https://api.spaceapi.io",
"LOCALSPACES_LOCAL_ENDPOINT": "https://api.leighhack.org/space.json",
"LOCALSPACES_DISTANCE": 450,
"LOCALSPACES_DISTANCE": 260,
}
)
app.config.from_prefixed_env()
Expand Down
2 changes: 1 addition & 1 deletion local_spaces/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def calculate_distance(src: tuple, dest: tuple) -> float:
dlat = lat2 - lat1
a = sin(dlat / 2) ** 2 + cos(lat1) * cos(lat2) * sin(dlon / 2) ** 2
c = 2 * asin(sqrt(a))
r = 6371 # Radius of earth in kilometers. Use 3956 for miles. Determines return value units.
r = 3956 # Radius of earth in kilometers. Use 3956 for miles. Determines return value units.
return c * r


Expand Down
2 changes: 1 addition & 1 deletion local_spaces/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<img id="space-logo" src="https://unsplash.it/64"/>
</figure>-->
<p id="space-status"></p>
<p>Distance: <b id="space-distance"></b> km</p>
<p>Distance: <b id="space-distance"></b> miles</p>
</div>
</div>
</template>
Expand Down

0 comments on commit 8ff4ef1

Please sign in to comment.