Umbenennung, Umstrukturierung, Doc-Strings
This commit is contained in:
38
kugel.py
38
kugel.py
@@ -6,6 +6,12 @@ import winkelumrechnungen as wu
|
||||
|
||||
|
||||
def cart2sph(point: NDArray) -> Tuple[float, float, float]:
|
||||
"""
|
||||
Umrechnung von kartesischen in sphärische Koordinaten
|
||||
# TODO: Quelle
|
||||
:param point: Punkt in kartesischen Koordinaten
|
||||
:return: Radius, Breite, Länge
|
||||
"""
|
||||
x, y, z = point
|
||||
r = sqrt(x**2 + y**2 + z**2)
|
||||
phi = arctan2(z, sqrt(x**2 + y**2))
|
||||
@@ -15,6 +21,14 @@ def cart2sph(point: NDArray) -> Tuple[float, float, float]:
|
||||
|
||||
|
||||
def sph2cart(r: float, phi: float, lamb: float) -> NDArray:
|
||||
"""
|
||||
Umrechnung von sphärischen in kartesische Koordinaten
|
||||
# TODO: Quelle
|
||||
:param r: Radius
|
||||
:param phi: Breite
|
||||
:param lamb: Länge
|
||||
:return: Punkt in kartesischen Koordinaten
|
||||
"""
|
||||
x = r * cos(phi) * cos(lamb)
|
||||
y = r * cos(phi) * sin(lamb)
|
||||
z = r * sin(phi)
|
||||
@@ -22,7 +36,17 @@ def sph2cart(r: float, phi: float, lamb: float) -> NDArray:
|
||||
return np.array([x, y, z])
|
||||
|
||||
|
||||
def gha1(R, phi0, lamb0, s, alpha0):
|
||||
def gha1(R: float, phi0: float, lamb0: float, s: float, alpha0: float) -> Tuple[float, float]:
|
||||
"""
|
||||
Berechnung der 1. GHA auf der Kugel
|
||||
# TODO: Quelle
|
||||
:param R: Radius
|
||||
:param phi0: Breite des Startpunktes
|
||||
:param lamb0: Länge des Startpunktes
|
||||
:param s: Strecke
|
||||
:param alpha0: Azimut
|
||||
:return: Breite, Länge des Zielpunktes
|
||||
"""
|
||||
s_ = s / R
|
||||
|
||||
lamb1 = lamb0 + arctan2(sin(s_) * sin(alpha0),
|
||||
@@ -33,7 +57,17 @@ def gha1(R, phi0, lamb0, s, alpha0):
|
||||
return phi1, lamb1
|
||||
|
||||
|
||||
def gha2(R, phi0, lamb0, phi1, lamb1):
|
||||
def gha2(R: float, phi0: float, lamb0: float, phi1: float, lamb1: float) -> Tuple[float, float, float]:
|
||||
"""
|
||||
Berechnung der 2. GHA auf der Kugel
|
||||
# TODO: Quelle
|
||||
:param R: Radius
|
||||
:param phi0: Breite des Startpunktes
|
||||
:param lamb0: Länge des Startpunktes
|
||||
:param phi1: Breite des Zielpunktes
|
||||
:param lamb1: Länge des Zielpunktes
|
||||
:return: Azimut im Startpunkt, Azimut im Zielpunkt, Strecke
|
||||
"""
|
||||
s_ = arccos(sin(phi0) * sin(phi1) + cos(phi0) * cos(phi1) * cos(lamb1 - lamb0))
|
||||
s = R * s_
|
||||
|
||||
|
||||
Reference in New Issue
Block a user