Aufgeräumt, Grundkonstrukt analytische Lösung
This commit is contained in:
101
ellipsoide.py
101
ellipsoide.py
@@ -135,7 +135,7 @@ class EllipsoidTriaxial:
|
||||
b = 6356754
|
||||
return cls(ax, ay, b)
|
||||
elif name == "Bessel-biaxial":
|
||||
ax = 6377397.155085
|
||||
ax = 6377397.15509
|
||||
ay = 6377397.15508
|
||||
b = 6356078.96290
|
||||
return cls(ax, ay, b)
|
||||
@@ -148,17 +148,20 @@ class EllipsoidTriaxial:
|
||||
:param u: Höhe
|
||||
:return: kartesische Koordinaten
|
||||
"""
|
||||
beta = wu.deg2rad(beta)
|
||||
lamb = wu.deg2rad(lamb)
|
||||
|
||||
# s1 = u**2 - self.b**2
|
||||
# s2 = -self.ay**2 * np.sin(beta)**2 - self.b**2 * np.cos(beta)**2
|
||||
# s3 = -self.ax**2 * np.sin(lamb)**2 - self.ay**2 * np.cos(lamb)**2
|
||||
s1 = u**2 - self.b**2
|
||||
s2 = -self.ay**2 * np.sin(beta)**2 - self.b**2 * np.cos(beta)**2
|
||||
s3 = -self.ax**2 * np.sin(lamb)**2 - self.ay**2 * np.cos(lamb)**2
|
||||
# print(s1, s2, s3)
|
||||
xe = np.sqrt(((self.ax**2+s1) * (self.ax**2+s2) * (self.ax**2+s3)) /
|
||||
((self.ax**2-self.ay**2) * (self.ax**2-self.b**2)))
|
||||
ye = np.sqrt(((self.ay**2+s1) * (self.ay**2+s2) * (self.ay**2+s3)) /
|
||||
((self.ay**2-self.ax**2) * (self.ay**2-self.b**2)))
|
||||
ze = np.sqrt(((self.b**2+s1) * (self.b**2+s2) * (self.b**2+s3)) /
|
||||
((self.b**2-self.ax**2) * (self.b**2-self.ax**2)))
|
||||
|
||||
x = np.sqrt(u**2 + self.ex**2) * np.sqrt(np.cos(beta)**2 + self.ee**2/self.ex**2 * np.sin(beta)**2) * np.cos(lamb)
|
||||
y = np.sqrt(u**2 + self.ey**2) * np.cos(beta) * np.sin(lamb)
|
||||
z = u * np.sin(beta) * np.sqrt(1 - self.ee**2/self.ex**2 * np.cos(lamb)**2)
|
||||
x = np.sqrt(u**2 + self.Ex**2) * np.sqrt(np.cos(beta)**2 + self.Ee**2/self.Ex**2 * np.sin(beta)**2) * np.cos(lamb)
|
||||
y = np.sqrt(u**2 + self.Ey**2) * np.cos(beta) * np.sin(lamb)
|
||||
z = u * np.sin(beta) * np.sqrt(1 - self.Ee**2/self.Ex**2 * np.cos(lamb)**2)
|
||||
|
||||
return x, y, z
|
||||
|
||||
@@ -232,35 +235,73 @@ class EllipsoidTriaxial:
|
||||
return phi, lamb, h
|
||||
|
||||
def geod2cart(self, phi, lamb, h):
|
||||
"""
|
||||
Ligas 2012, 250
|
||||
:param phi:
|
||||
:param lamb:
|
||||
:param h:
|
||||
:return:
|
||||
"""
|
||||
v = self.ax / np.sqrt(1 - self.ex**2*np.sin(phi)**2-self.ee**2*np.cos(phi)**2*np.sin(lamb)**2)
|
||||
xG = (v + h) * np.cos(phi) * np.cos(lamb)
|
||||
yG = (v * (1-self.ee**2) + h) * np.cos(phi) * np.sin(lamb)
|
||||
zG = (v * (1-self.ex**2) + h) * np.sin(phi)
|
||||
return xG, yG, zG
|
||||
|
||||
def para2cart(self, u, v):
|
||||
"""
|
||||
Panou, Korakitits 2020, 4
|
||||
:param u:
|
||||
:param v:
|
||||
:return:
|
||||
"""
|
||||
x = self.ax * np.cos(u) * np.cos(v)
|
||||
y = self.ay * np.cos(u) * np.cos(v)
|
||||
z = self.b * np.sin(u)
|
||||
|
||||
def cart2para(self, x, y, z):
|
||||
"""
|
||||
Panou, Korakitits 2020, 4
|
||||
:param x:
|
||||
:param y:
|
||||
:param z:
|
||||
:return:
|
||||
"""
|
||||
if z*np.sqrt(1-self.ee**2) <= np.sqrt(x**2 * (1-self.ee**2)+y**2) * np.sqrt(1-self.ex**2):
|
||||
u = np.arctan(z*np.sqrt(1-self.ee**2) / np.sqrt(x**2 * (1-self.ee**2)+y**2) * np.sqrt(1-self.ex**2))
|
||||
else:
|
||||
u = np.arctan(np.sqrt(x**2 * (1-self.ee**2)+y**2) * np.sqrt(1-self.ex**2) / z*np.sqrt(1-self.ee**2))
|
||||
|
||||
if y <= x*np.sqrt(1-self.ee**2):
|
||||
v = 2*np.arctan(y/(x*np.sqrt(1-self.ee**2) + np.sqrt(x**2*(1-self.ee**2)+y**2)))
|
||||
else:
|
||||
v = np.pi/2 - 2*np.arctan(x*np.sqrt(1-self.ee**2) / (y + np.sqrt(x**2*(1-self.ee**2)+y**2)))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
ellips = EllipsoidTriaxial.init_name("Eitschberger1978")
|
||||
# ellips = EllipsoidTriaxial.init_name("Bursa1972")
|
||||
# carts = ellips.ell2cart(10, 30, 6378172)
|
||||
# ells = ellips.cart2ell(carts[0], carts[1], carts[2])
|
||||
|
||||
# carts = ellips.ell2cart(10, 25, 6378293.435)
|
||||
# print(aus.gms("beta", ells[0], 3), aus.gms("lambda", ells[1], 3), "u =", ells[2])
|
||||
stellen = 20
|
||||
geod1 = ellips.cart2geod("ligas1", 5712200, 2663400, 1106000)
|
||||
print(aus.gms("phi", geod1[0], stellen), aus.gms("lambda", geod1[1], stellen), "h =", geod1[2])
|
||||
geod2 = ellips.cart2geod("ligas2", 5712200, 2663400, 1106000)
|
||||
print(aus.gms("phi", geod2[0], stellen), aus.gms("lambda", geod2[1], stellen), "h =", geod2[2])
|
||||
geod3 = ellips.cart2geod("ligas3", 5712200, 2663400, 1106000)
|
||||
print(aus.gms("phi", geod3[0], stellen), aus.gms("lambda", geod3[1], stellen), "h =", geod3[2])
|
||||
cart1 = ellips.geod2cart(geod1[0], geod1[1], geod1[2])
|
||||
print(aus.xyz(cart1[0], cart1[1], cart1[2], 10))
|
||||
cart2 = ellips.geod2cart(geod2[0], geod2[1], geod2[2])
|
||||
print(aus.xyz(cart2[0], cart2[1], cart2[2], 10))
|
||||
cart3 = ellips.geod2cart(geod3[0], geod3[1], geod3[2])
|
||||
print(aus.xyz(cart3[0], cart3[1], cart3[2], 10))
|
||||
carts = ellips.ell2cart(wu.deg2rad(10), wu.deg2rad(30), 6378172)
|
||||
ells = ellips.cart2ell(carts[0], carts[1], carts[2])
|
||||
print(aus.gms("beta", ells[0], 3), aus.gms("lambda", ells[1], 3), "u =", ells[2])
|
||||
ells2 = ellips.cart2ell(5712200, 2663400, 1106000)
|
||||
carts2 = ellips.ell2cart(ells2[0], ells2[1], ells2[2])
|
||||
print(aus.xyz(carts2[0], carts2[1], carts2[2], 10))
|
||||
|
||||
test_cart = ellips.geod2cart(0.175, 0.444, 100)
|
||||
print(aus.xyz(test_cart[0], test_cart[1], test_cart[2], 10))
|
||||
# stellen = 20
|
||||
# geod1 = ellips.cart2geod("ligas1", 5712200, 2663400, 1106000)
|
||||
# print(aus.gms("phi", geod1[0], stellen), aus.gms("lambda", geod1[1], stellen), "h =", geod1[2])
|
||||
# geod2 = ellips.cart2geod("ligas2", 5712200, 2663400, 1106000)
|
||||
# print(aus.gms("phi", geod2[0], stellen), aus.gms("lambda", geod2[1], stellen), "h =", geod2[2])
|
||||
# geod3 = ellips.cart2geod("ligas3", 5712200, 2663400, 1106000)
|
||||
# print(aus.gms("phi", geod3[0], stellen), aus.gms("lambda", geod3[1], stellen), "h =", geod3[2])
|
||||
# cart1 = ellips.geod2cart(geod1[0], geod1[1], geod1[2])
|
||||
# print(aus.xyz(cart1[0], cart1[1], cart1[2], 10))
|
||||
# cart2 = ellips.geod2cart(geod2[0], geod2[1], geod2[2])
|
||||
# print(aus.xyz(cart2[0], cart2[1], cart2[2], 10))
|
||||
# cart3 = ellips.geod2cart(geod3[0], geod3[1], geod3[2])
|
||||
# print(aus.xyz(cart3[0], cart3[1], cart3[2], 10))
|
||||
|
||||
# test_cart = ellips.geod2cart(0.175, 0.444, 100)
|
||||
# print(aus.xyz(test_cart[0], test_cart[1], test_cart[2], 10))
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user