mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-08-07 09:22:44 +02:00
Update space.py
This commit is contained in:
+2
-2
@@ -240,12 +240,12 @@ def measureHeight(lat=0, lon=0, shadow=0):
|
||||
return "☀️Sun is below horizon, I dont belive your shadow measurement"
|
||||
try:
|
||||
if use_metric:
|
||||
height = float(shadow) * (1 / math.tan(sun.alt))
|
||||
height = float(shadow) * math.tan(sun.alt)
|
||||
return f"📏Object Height: {height:.2f} m (Shadow: {shadow} m, 📐Sun Alt: {sun_altitude:.2f}°)"
|
||||
else:
|
||||
# Assume shadow is in feet if imperial, otherwise convert from meters to feet
|
||||
shadow_ft = float(shadow)
|
||||
height_ft = shadow_ft * (1 / math.tan(sun.alt))
|
||||
height_ft = shadow_ft * math.tan(sun.alt)
|
||||
return f"📏Object Height: {height_ft:.2f} ft (Shadow: {shadow_ft} ft, 📐Sun Alt: {sun_altitude:.2f}°)"
|
||||
except Exception as e:
|
||||
logger.error(f"Space: Error calculating height: {e}")
|
||||
|
||||
Reference in New Issue
Block a user