kleine Anpassungen
This commit is contained in:
@@ -13,7 +13,7 @@ import GHA_triaxial.numeric_examples_panou as nep
|
|||||||
|
|
||||||
|
|
||||||
def gha1_num_old(ell: ellipsoide.EllipsoidTriaxial, point, alpha0, s, num):
|
def gha1_num_old(ell: ellipsoide.EllipsoidTriaxial, point, alpha0, s, num):
|
||||||
phi, lamb, h = ell.cart2geod("ligas3", point)
|
phi, lamb, h = ell.cart2geod(point, "ligas3")
|
||||||
x, y, z = ell.geod2cart(phi, lamb, 0)
|
x, y, z = ell.geod2cart(phi, lamb, 0)
|
||||||
p, q = ell.p_q(x, y, z)
|
p, q = ell.p_q(x, y, z)
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ def buildODE(ell):
|
|||||||
return ODE
|
return ODE
|
||||||
|
|
||||||
def gha1_num(ell, point, alpha0, s, num):
|
def gha1_num(ell, point, alpha0, s, num):
|
||||||
phi, lam, _ = ell.cart2geod("ligas3", point)
|
phi, lam, _ = ell.cart2geod(point, "ligas3")
|
||||||
x0, y0, z0 = ell.geod2cart(phi, lam, 0)
|
x0, y0, z0 = ell.geod2cart(phi, lam, 0)
|
||||||
|
|
||||||
p, q = ell.p_q(x0, y0, z0)
|
p, q = ell.p_q(x0, y0, z0)
|
||||||
|
|||||||
@@ -20,9 +20,8 @@ def ellipsoid_figure(ax, ay, b, pts=None, lines=None, title="Dreiachsiges Ellips
|
|||||||
u = np.linspace(-np.pi/2, np.pi/2, 80)
|
u = np.linspace(-np.pi/2, np.pi/2, 80)
|
||||||
v = np.linspace(-np.pi, np.pi, 160)
|
v = np.linspace(-np.pi, np.pi, 160)
|
||||||
U, V = np.meshgrid(u, v)
|
U, V = np.meshgrid(u, v)
|
||||||
X = ax * np.cos(U) * np.cos(V)
|
ell = EllipsoidTriaxial(ax, ay, b)
|
||||||
Y = ay * np.cos(U) * np.sin(V)
|
X, Y, Z = ell.para2cart(U, V)
|
||||||
Z = b * np.sin(U)
|
|
||||||
|
|
||||||
fig = go.Figure()
|
fig = go.Figure()
|
||||||
fig.add_trace(go.Surface(
|
fig.add_trace(go.Surface(
|
||||||
@@ -35,11 +34,9 @@ def ellipsoid_figure(ax, ay, b, pts=None, lines=None, title="Dreiachsiges Ellips
|
|||||||
meridians_deg = np.arange(0, 360, 15)
|
meridians_deg = np.arange(0, 360, 15)
|
||||||
lat_line = np.linspace(-np.pi/2, np.pi/2, 240)
|
lat_line = np.linspace(-np.pi/2, np.pi/2, 240)
|
||||||
for lon_deg in meridians_deg:
|
for lon_deg in meridians_deg:
|
||||||
lam = np.deg2rad(lon_deg)
|
um = np.deg2rad(lon_deg)
|
||||||
phi = lat_line
|
vm = lat_line
|
||||||
xm = ax * np.cos(phi) * np.cos(lam)
|
xm, ym, zm = ell.para2cart(um, vm)
|
||||||
ym = ay * np.cos(phi) * np.sin(lam)
|
|
||||||
zm = b * np.sin(phi)
|
|
||||||
fig.add_trace(go.Scatter3d(
|
fig.add_trace(go.Scatter3d(
|
||||||
x=xm, y=ym, z=zm, mode="lines",
|
x=xm, y=ym, z=zm, mode="lines",
|
||||||
line=dict(width=1, color="black"),
|
line=dict(width=1, color="black"),
|
||||||
@@ -48,11 +45,9 @@ def ellipsoid_figure(ax, ay, b, pts=None, lines=None, title="Dreiachsiges Ellips
|
|||||||
parallels_deg = np.arange(-75, 90, 15)
|
parallels_deg = np.arange(-75, 90, 15)
|
||||||
lon_line = np.linspace(0, 2*np.pi, 360)
|
lon_line = np.linspace(0, 2*np.pi, 360)
|
||||||
for lat_deg in parallels_deg:
|
for lat_deg in parallels_deg:
|
||||||
phi = np.deg2rad(lat_deg)
|
vp = np.deg2rad(lat_deg)
|
||||||
lam = lon_line
|
up = lon_line
|
||||||
xp = ax * np.cos(phi) * np.cos(lam)
|
xp, yp, zp = ell.para2cart(up, vp)
|
||||||
yp = ay * np.cos(phi) * np.sin(lam)
|
|
||||||
zp = b * np.sin(phi) * np.ones_like(lam)
|
|
||||||
fig.add_trace(go.Scatter3d(
|
fig.add_trace(go.Scatter3d(
|
||||||
x=xp, y=yp, z=zp, mode="lines",
|
x=xp, y=yp, z=zp, mode="lines",
|
||||||
line=dict(width=1, color="black"),
|
line=dict(width=1, color="black"),
|
||||||
@@ -70,14 +65,14 @@ def ellipsoid_figure(ax, ay, b, pts=None, lines=None, title="Dreiachsiges Ellips
|
|||||||
))
|
))
|
||||||
|
|
||||||
if lines:
|
if lines:
|
||||||
for (p1, p2) in lines:
|
for (p1, p2, color) in lines:
|
||||||
xline = [p1[0], p2[0]]
|
xline = [p1[0], p2[0]]
|
||||||
yline = [p1[1], p2[1]]
|
yline = [p1[1], p2[1]]
|
||||||
zline = [p1[2], p2[2]]
|
zline = [p1[2], p2[2]]
|
||||||
fig.add_trace(go.Scatter3d(
|
fig.add_trace(go.Scatter3d(
|
||||||
x=xline, y=yline, z=zline,
|
x=xline, y=yline, z=zline,
|
||||||
mode="lines",
|
mode="lines",
|
||||||
line=dict(width=4, color="red"),
|
line=dict(width=4, color=color),
|
||||||
showlegend=False
|
showlegend=False
|
||||||
))
|
))
|
||||||
|
|
||||||
@@ -348,7 +343,7 @@ def calc_and_plot(n1, n2,
|
|||||||
fig = ellipsoid_figure(
|
fig = ellipsoid_figure(
|
||||||
ell.ax, ell.ay, ell.b,
|
ell.ax, ell.ay, ell.b,
|
||||||
pts=[("P1", p1, "black"), ("P2", p2, "red")],
|
pts=[("P1", p1, "black"), ("P2", p2, "red")],
|
||||||
lines=[(p1, p2)],
|
lines=[(p1, p2, "red")],
|
||||||
title="Erste Hauptaufgabe - analystisch"
|
title="Erste Hauptaufgabe - analystisch"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -371,7 +366,7 @@ def calc_and_plot(n1, n2,
|
|||||||
fig = ellipsoid_figure(
|
fig = ellipsoid_figure(
|
||||||
ell.ax, ell.ay, ell.b,
|
ell.ax, ell.ay, ell.b,
|
||||||
pts=[("P1", p1, "black"), ("P2", p2, "red")],
|
pts=[("P1", p1, "black"), ("P2", p2, "red")],
|
||||||
lines=[(p1, p2)],
|
lines=[(p1, p2, "red")],
|
||||||
title=f"Zweite Hauptaufgabe - numerisch"
|
title=f"Zweite Hauptaufgabe - numerisch"
|
||||||
)
|
)
|
||||||
out2 = f"a₁₂={np.rad2deg(alpha_1):.6f}°, a₂₁={np.rad2deg(alpha_2):.6f}°, s={s12:.4f} m"
|
out2 = f"a₁₂={np.rad2deg(alpha_1):.6f}°, a₂₁={np.rad2deg(alpha_2):.6f}°, s={s12:.4f} m"
|
||||||
@@ -151,10 +151,15 @@ class EllipsoidTriaxial:
|
|||||||
b = 6356078.96290
|
b = 6356078.96290
|
||||||
return cls(ax, ay, b)
|
return cls(ax, ay, b)
|
||||||
elif name == "Fiction":
|
elif name == "Fiction":
|
||||||
ax = 5500000
|
ax = 6000000
|
||||||
ay = 4500000
|
ay = 5000000
|
||||||
b = 4000000
|
b = 4000000
|
||||||
return cls(ax, ay, b)
|
return cls(ax, ay, b)
|
||||||
|
elif name == "KarneyTest2024":
|
||||||
|
ax = np.sqrt(2)
|
||||||
|
ay = 1
|
||||||
|
b = 1 / np.sqrt(2)
|
||||||
|
return cls(ax, ay, b)
|
||||||
|
|
||||||
def point_on(self, point: np.ndarray) -> bool:
|
def point_on(self, point: np.ndarray) -> bool:
|
||||||
"""
|
"""
|
||||||
@@ -171,7 +176,7 @@ class EllipsoidTriaxial:
|
|||||||
def ellu2cart(self, beta: float, lamb: float, u: float) -> np.ndarray:
|
def ellu2cart(self, beta: float, lamb: float, u: float) -> np.ndarray:
|
||||||
"""
|
"""
|
||||||
Panou 2014 12ff.
|
Panou 2014 12ff.
|
||||||
Ellipsoidische Breite+Länge sind nicht gleich der geodätischen
|
Elliptische Breite+Länge sind nicht gleich der geodätischen
|
||||||
Verhältnisse des Ellipsoids bekannt, Größe verändern bis Punkt erreicht,
|
Verhältnisse des Ellipsoids bekannt, Größe verändern bis Punkt erreicht,
|
||||||
dann ist u die Größe entlang der z-Achse
|
dann ist u die Größe entlang der z-Achse
|
||||||
:param beta: ellipsoidische Breite [rad]
|
:param beta: ellipsoidische Breite [rad]
|
||||||
@@ -200,8 +205,8 @@ class EllipsoidTriaxial:
|
|||||||
def ell2cart(self, beta: float, lamb: float) -> np.ndarray:
|
def ell2cart(self, beta: float, lamb: float) -> np.ndarray:
|
||||||
"""
|
"""
|
||||||
Panou, Korakitis 2019 2
|
Panou, Korakitis 2019 2
|
||||||
:param beta: ellipsoidische Breite [rad]
|
:param beta: elliptische Breite [rad]
|
||||||
:param lamb: ellipsoidische Länge [rad]
|
:param lamb: elliptische Länge [rad]
|
||||||
:return: Punkt in kartesischen Koordinaten
|
:return: Punkt in kartesischen Koordinaten
|
||||||
"""
|
"""
|
||||||
if beta == -np.pi/2:
|
if beta == -np.pi/2:
|
||||||
@@ -228,7 +233,7 @@ class EllipsoidTriaxial:
|
|||||||
"""
|
"""
|
||||||
Panou 2014 15ff.
|
Panou 2014 15ff.
|
||||||
:param point: Punkt in kartesischen Koordinaten
|
:param point: Punkt in kartesischen Koordinaten
|
||||||
:return: ellipsoidische Breite, ellipsoidische Länge, Größe entlang der z-Achse
|
:return: elliptische Breite, elliptische Länge, Größe entlang der z-Achse
|
||||||
"""
|
"""
|
||||||
x, y, z = point
|
x, y, z = point
|
||||||
c2 = self.ax**2 + self.ay**2 + self.b**2 - x**2 - y**2 - z**2
|
c2 = self.ax**2 + self.ay**2 + self.b**2 - x**2 - y**2 - z**2
|
||||||
@@ -259,7 +264,7 @@ class EllipsoidTriaxial:
|
|||||||
"""
|
"""
|
||||||
Panou, Korakitis 2019 2f.
|
Panou, Korakitis 2019 2f.
|
||||||
:param point: Punkt in kartesischen Koordinaten
|
:param point: Punkt in kartesischen Koordinaten
|
||||||
:return: ellipsoidische Breite, ellipsoidische Länge
|
:return: elliptische Breite, elliptische Länge
|
||||||
"""
|
"""
|
||||||
x, y, z = point
|
x, y, z = point
|
||||||
|
|
||||||
@@ -316,7 +321,7 @@ class EllipsoidTriaxial:
|
|||||||
|
|
||||||
return beta, lamb
|
return beta, lamb
|
||||||
|
|
||||||
def cart2geod(self, mode: str, point: np.ndarray, maxIter: int = 30, maxLoa: float = 0.005) -> tuple[float, float, float]:
|
def cart2geod(self, point: np.ndarray, mode: str = "ligas3", maxIter: int = 30, maxLoa: float = 0.005) -> tuple[float, float, float]:
|
||||||
"""
|
"""
|
||||||
Ligas 2012
|
Ligas 2012
|
||||||
:param mode: ligas1, ligas2, oder ligas3
|
:param mode: ligas1, ligas2, oder ligas3
|
||||||
@@ -405,7 +410,7 @@ class EllipsoidTriaxial:
|
|||||||
:param point: Punkt in kartesischen Koordinaten, der gelotet werden soll
|
:param point: Punkt in kartesischen Koordinaten, der gelotet werden soll
|
||||||
:return: Lotpunkt in kartesischen Koordinaten, geodätische Koordinaten des Punktes
|
:return: Lotpunkt in kartesischen Koordinaten, geodätische Koordinaten des Punktes
|
||||||
"""
|
"""
|
||||||
phi, lamb, h = self.cart2geod("ligas3", point)
|
phi, lamb, h = self.cart2geod(point, "ligas3")
|
||||||
x, y, z = self. geod2cart(phi, lamb, 0)
|
x, y, z = self. geod2cart(phi, lamb, 0)
|
||||||
return np.array([x, y, z]), phi, lamb, h
|
return np.array([x, y, z]), phi, lamb, h
|
||||||
|
|
||||||
@@ -416,7 +421,7 @@ class EllipsoidTriaxial:
|
|||||||
:param h: Höhe über dem Ellipsoid
|
:param h: Höhe über dem Ellipsoid
|
||||||
:return: hochgeloteter Punkt
|
:return: hochgeloteter Punkt
|
||||||
"""
|
"""
|
||||||
phi, lamb, _ = self.cart2geod("ligas3", point)
|
phi, lamb, _ = self.cart2geod(point, "ligas3")
|
||||||
pointH = self. geod2cart(phi, lamb, h)
|
pointH = self. geod2cart(phi, lamb, h)
|
||||||
return pointH
|
return pointH
|
||||||
|
|
||||||
@@ -430,6 +435,7 @@ class EllipsoidTriaxial:
|
|||||||
x = self.ax * np.cos(u) * np.cos(v)
|
x = self.ax * np.cos(u) * np.cos(v)
|
||||||
y = self.ay * np.cos(u) * np.sin(v)
|
y = self.ay * np.cos(u) * np.sin(v)
|
||||||
z = self.b * np.sin(u)
|
z = self.b * np.sin(u)
|
||||||
|
z = np.broadcast_to(z, np.shape(x))
|
||||||
return np.array([x, y, z])
|
return np.array([x, y, z])
|
||||||
|
|
||||||
def cart2para(self, point: np.ndarray) -> tuple[float, float]:
|
def cart2para(self, point: np.ndarray) -> tuple[float, float]:
|
||||||
@@ -457,6 +463,26 @@ class EllipsoidTriaxial:
|
|||||||
|
|
||||||
return u, v
|
return u, v
|
||||||
|
|
||||||
|
def ell2para(self, beta, lamb) -> tuple[float, float]:
|
||||||
|
cart = self.ell2cart(beta, lamb)
|
||||||
|
return self.cart2para(cart)
|
||||||
|
|
||||||
|
def para2ell(self, u, v) -> tuple[float, float]:
|
||||||
|
cart = self.para2cart(u, v)
|
||||||
|
return self.cart2ell(cart)
|
||||||
|
|
||||||
|
def para2geod(self, u: float, v: float, mode: str = "ligas3", maxIter: int = 30, maxLoa: float = 0.005) -> tuple[float, float, float]:
|
||||||
|
cart = self.para2cart(u, v)
|
||||||
|
return self.cart2geod(cart, mode, maxIter, maxLoa)
|
||||||
|
|
||||||
|
def geod2para(self, phi, lamb, h) -> tuple[float, float]:
|
||||||
|
cart = self.geod2cart(phi, lamb, h)
|
||||||
|
return self.cart2para(cart)
|
||||||
|
|
||||||
|
def ell2geod(self, beta, lamb, mode: str = "ligas3", maxIter: int = 30, maxLoa: float = 0.005) -> tuple[float, float, float]:
|
||||||
|
cart = self.ell2cart(beta, lamb)
|
||||||
|
return self.cart2geod(cart, mode, maxIter, maxLoa)
|
||||||
|
|
||||||
def func_H(self, x, y, z):
|
def func_H(self, x, y, z):
|
||||||
return x ** 2 + y ** 2 / (1 - self.ee ** 2) ** 2 + z ** 2 / (1 - self.ex ** 2) ** 2
|
return x ** 2 + y ** 2 / (1 - self.ee ** 2) ** 2 + z ** 2 / (1 - self.ex ** 2) ** 2
|
||||||
|
|
||||||
@@ -523,19 +549,20 @@ if __name__ == "__main__":
|
|||||||
cart_para = ell.para2cart(para[0], para[1])
|
cart_para = ell.para2cart(para[0], para[1])
|
||||||
diff_para = np.sum(np.abs(point-cart_para))
|
diff_para = np.sum(np.abs(point-cart_para))
|
||||||
|
|
||||||
geod = ell.cart2geod("ligas1", point)
|
# geod = ell.cart2geod(point, "ligas1")
|
||||||
cart_geod = ell.geod2cart(geod[0], geod[1], geod[2])
|
# cart_geod = ell.geod2cart(geod[0], geod[1], geod[2])
|
||||||
diff_geod1 = np.sum(np.abs(point-cart_geod))
|
# diff_geod1 = np.sum(np.abs(point-cart_geod))
|
||||||
|
#
|
||||||
|
# geod = ell.cart2geod(point, "ligas2")
|
||||||
|
# cart_geod = ell.geod2cart(geod[0], geod[1], geod[2])
|
||||||
|
# diff_geod2 = np.sum(np.abs(point-cart_geod))
|
||||||
|
|
||||||
geod = ell.cart2geod("ligas2", point)
|
geod = ell.cart2geod(point, "ligas3")
|
||||||
cart_geod = ell.geod2cart(geod[0], geod[1], geod[2])
|
|
||||||
diff_geod2 = np.sum(np.abs(point-cart_geod))
|
|
||||||
|
|
||||||
geod = ell.cart2geod("ligas3", point)
|
|
||||||
cart_geod = ell.geod2cart(geod[0], geod[1], geod[2])
|
cart_geod = ell.geod2cart(geod[0], geod[1], geod[2])
|
||||||
diff_geod3 = np.sum(np.abs(point-cart_geod))
|
diff_geod3 = np.sum(np.abs(point-cart_geod))
|
||||||
|
|
||||||
diff_list.append([beta_deg, lamb_deg, diff_ell, diff_para, diff_geod1, diff_geod2, diff_geod3])
|
diff_list.append([beta_deg, lamb_deg, diff_ell, diff_para, diff_geod3])
|
||||||
|
diff_list.append([diff_ell])
|
||||||
|
|
||||||
diff_list = np.array(diff_list)
|
diff_list = np.array(diff_list)
|
||||||
pass
|
pass
|
||||||
30
show_constant_lines.py
Normal file
30
show_constant_lines.py
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import numpy as np
|
||||||
|
import plotly.graph_objects as go
|
||||||
|
from ellipsoide import EllipsoidTriaxial
|
||||||
|
import winkelumrechnungen as wu
|
||||||
|
from dashboard import ellipsoid_figure
|
||||||
|
|
||||||
|
u = np.linspace(0, 2*np.pi, 51)
|
||||||
|
v = np.linspace(0, np.pi, 51)
|
||||||
|
ell = EllipsoidTriaxial.init_name("BursaSima1980round")
|
||||||
|
points = []
|
||||||
|
lines = []
|
||||||
|
for u_i, u_value in enumerate(u):
|
||||||
|
for v_i, v_value in enumerate(v):
|
||||||
|
cart = ell.ell2cart(u_value, v_value)
|
||||||
|
if u_i != 0 and v_i != 0:
|
||||||
|
lines.append((points[-1], cart, "red"))
|
||||||
|
points.append(cart)
|
||||||
|
points = []
|
||||||
|
for v_i, v_value in enumerate(v):
|
||||||
|
for u_i, u_value in enumerate(u):
|
||||||
|
cart = ell.ell2cart(u_value, v_value)
|
||||||
|
if u_i != 0 and v_i != 0:
|
||||||
|
lines.append((points[-1], cart, "blue"))
|
||||||
|
points.append(cart)
|
||||||
|
ax = ell.ax
|
||||||
|
ay = ell.ay
|
||||||
|
b = ell.b
|
||||||
|
|
||||||
|
figu = ellipsoid_figure(ax, ay, b, lines=lines)
|
||||||
|
figu.show()
|
||||||
Reference in New Issue
Block a user