MCPcopy Create free account
hub / github.com/Tong89/smartNode / calc_central_angle

Function calc_central_angle

backend/orbit.py:43–51  ·  view source on GitHub ↗

计算球面大圆地心角 (Degrees)

(lat1, lon1, lat2, lon2)

Source from the content-addressed store, hash-verified

41
42
43def calc_central_angle(lat1, lon1, lat2, lon2):
44 """计算球面大圆地心角 (Degrees)"""
45 rad = math.pi / 180.0
46 phi1, phi2 = lat1 * rad, lat2 * rad
47 dphi = (lat2 - lat1) * rad
48 dlam = (lon2 - lon1) * rad
49 a = math.sin(dphi / 2) ** 2 + math.cos(phi1) * math.cos(phi2) * math.sin(dlam / 2) ** 2
50 c = 2 * math.atan2(math.sqrt(a), math.sqrt(1 - a))
51 return c * 180.0 / math.pi
52
53
54class OrbitalElements:

Callers 15

test_quarter_equatorMethod · 0.90
test_symmetryMethod · 0.90
test_non_negativeMethod · 0.90
test_max_is_180Method · 0.90
test_golden_diagonalMethod · 0.90

Calls

no outgoing calls