abstract-math 0.0.0.34__py3-none-any.whl → 0.0.0.36__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of abstract-math might be problematic. Click here for more details.
- abstract_math/solar_math/src/constants/planet_constants.py +1 -1
- abstract_math/solar_math/src/utils/geometry_utils.py +9 -9
- {abstract_math-0.0.0.34.dist-info → abstract_math-0.0.0.36.dist-info}/METADATA +1 -1
- {abstract_math-0.0.0.34.dist-info → abstract_math-0.0.0.36.dist-info}/RECORD +6 -6
- {abstract_math-0.0.0.34.dist-info → abstract_math-0.0.0.36.dist-info}/WHEEL +0 -0
- {abstract_math-0.0.0.34.dist-info → abstract_math-0.0.0.36.dist-info}/top_level.txt +0 -0
|
@@ -67,7 +67,7 @@ def get_planet_vars(name: str, dist_unit: str = "meters") -> Dict[str, Any]:
|
|
|
67
67
|
if body is None:
|
|
68
68
|
raise KeyError(f"Unknown body '{name}'. Available: {sorted(_BODY_BY_NAME.keys())}")
|
|
69
69
|
|
|
70
|
-
dist_unit_norm = normalize_distance_unit(
|
|
70
|
+
dist_unit_norm = normalize_distance_unit(dist_unit)
|
|
71
71
|
r_m = body["radius"]
|
|
72
72
|
d_m = body["diameter"]
|
|
73
73
|
|
|
@@ -14,23 +14,23 @@ def get_h_cap(r_m: float, h_m: float, theta: Optional[float] = None) -> float:
|
|
|
14
14
|
theta = get_central_angle(r_m, h_m)
|
|
15
15
|
return mul(r_m, sub(1.0, math.cos(theta)))
|
|
16
16
|
|
|
17
|
-
def spherical_cap_area(observer_altitude: float,
|
|
17
|
+
def spherical_cap_area(observer_altitude: float, dist_unit: str = 'meters'):
|
|
18
18
|
"""
|
|
19
19
|
Visible spherical cap area from altitude (same units as input returned in unit^2).
|
|
20
20
|
"""
|
|
21
21
|
r_m = earth_radius('meters')
|
|
22
|
-
h_m = convert(observer_altitude,
|
|
22
|
+
h_m = convert(observer_altitude, dist_unit, 'meters')
|
|
23
23
|
|
|
24
24
|
theta = get_central_angle(r_m, h_m)
|
|
25
25
|
h_cap_m = get_h_cap(r_m, h_m, theta)
|
|
26
26
|
area_m2 = mul(2 * pi() * r_m, h_cap_m) # 2π R h
|
|
27
27
|
# return in requested units^2
|
|
28
|
-
area_u2 = mul(area_m2, exp(_factor('meters',
|
|
29
|
-
return area_u2, convert(h_cap_m, 'meters',
|
|
28
|
+
area_u2 = mul(area_m2, exp(_factor('meters', dist_unit), 2))
|
|
29
|
+
return area_u2, convert(h_cap_m, 'meters', dist_unit), theta
|
|
30
30
|
|
|
31
|
-
def percent_visible(observer_altitude: float,
|
|
32
|
-
cap_area_u2, _, _ = spherical_cap_area(observer_altitude,
|
|
33
|
-
full_area_u2 = full_earth_surface_area(
|
|
31
|
+
def percent_visible(observer_altitude: float, dist_unit: str = 'meters') -> float:
|
|
32
|
+
cap_area_u2, _, _ = spherical_cap_area(observer_altitude, dist_unit)
|
|
33
|
+
full_area_u2 = full_earth_surface_area(dist_unit)
|
|
34
34
|
return mul(div(cap_area_u2, full_area_u2), 100.0)
|
|
35
35
|
|
|
36
36
|
# --- Camera/FOV flat-projection helper (approximate) ---
|
|
@@ -70,9 +70,9 @@ def get_triangle_heights(a: float, b: float, c: float, area: float):
|
|
|
70
70
|
hc = mul(2.0, div(area, c))
|
|
71
71
|
return {"ha": ha, "hb": hb, "hc": hc}
|
|
72
72
|
|
|
73
|
-
def compute_fov_triangle(altitude: float, fov_angle_deg: float,
|
|
73
|
+
def compute_fov_triangle(altitude: float, fov_angle_deg: float, dist_unit: str = 'meters'):
|
|
74
74
|
"""Simple isosceles triangle model for a camera at altitude."""
|
|
75
|
-
a =
|
|
75
|
+
a = dconvert(altitude, dist_unit, 'meters')
|
|
76
76
|
fov_angle_rad = math.radians(fov_angle_deg)
|
|
77
77
|
base = 2.0 * a * math.tan(fov_angle_rad / 2.0)
|
|
78
78
|
b = c = a
|
|
@@ -11,13 +11,13 @@ abstract_math/solar_math/src/__init__.py,sha256=qeal73F-NLu6sO_YSmD_komVpe17f0OF
|
|
|
11
11
|
abstract_math/solar_math/src/imports.py,sha256=aiFyZLsoVwkGopAL0uLaIPordUizM7UT9shwShmf0f0,195
|
|
12
12
|
abstract_math/solar_math/src/constants/__init__.py,sha256=VSo386-vGfJirycDGRGmLrjmi8GLXXW0kXJr2E7ZAnI,810
|
|
13
13
|
abstract_math/solar_math/src/constants/distance_constants.py,sha256=evHBfNI9LlZVW2O78VbIyLyBAFrOyr2Bkj_Z6tZhgas,2913
|
|
14
|
-
abstract_math/solar_math/src/constants/planet_constants.py,sha256=
|
|
14
|
+
abstract_math/solar_math/src/constants/planet_constants.py,sha256=tc5Woh3Gqme66urafB-JvEwtB4ktC976_MqhRzg_XeE,6968
|
|
15
15
|
abstract_math/solar_math/src/constants/time_constants.py,sha256=9_7gCR3swAjyUwFNLja1keRxTYx4kzF39TB9Vwav_PM,1960
|
|
16
16
|
abstract_math/solar_math/src/utils/__init__.py,sha256=Vb2bfx1p9YSmhnbqXBjGVPt1OQZ9I7PG_fMQdFqj-3k,91
|
|
17
17
|
abstract_math/solar_math/src/utils/escape_velocity.py,sha256=rZkwf6gaBpciCmxUKnzLGXfI5P9JRkFSLyCvXNcsLtk,5245
|
|
18
|
-
abstract_math/solar_math/src/utils/geometry_utils.py,sha256=
|
|
18
|
+
abstract_math/solar_math/src/utils/geometry_utils.py,sha256=RDIdcMgxSBI8XqTp7Q_co_xjHsRztTx4op7D-tgOCWM,4206
|
|
19
19
|
abstract_math/solar_math/src/utils/velocity_utils.py,sha256=se1RiyLN3uhJwXy42_6JFidbDECWB_sVzt8F6HXK0x0,2211
|
|
20
|
-
abstract_math-0.0.0.
|
|
21
|
-
abstract_math-0.0.0.
|
|
22
|
-
abstract_math-0.0.0.
|
|
23
|
-
abstract_math-0.0.0.
|
|
20
|
+
abstract_math-0.0.0.36.dist-info/METADATA,sha256=UfsY2XahmYw84k1dy1T1e-EA2nOwn4pQl7i1PcC3F6k,3081
|
|
21
|
+
abstract_math-0.0.0.36.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
22
|
+
abstract_math-0.0.0.36.dist-info/top_level.txt,sha256=b7jOgD9c0U-CGH-l7yxhMPukzD40kMEQkQRV_sGyVfE,14
|
|
23
|
+
abstract_math-0.0.0.36.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|