This commit is contained in:
2026-01-19 14:48:24 +01:00
parent d2b6f604f0
commit 7a170f5ead
11 changed files with 56477 additions and 43084 deletions

View File

@@ -1,63 +1,67 @@
from typing import Any
import sympy as sp
from decimal import Decimal
import math
import numpy as np
from numpy import ndarray, dtype
import Datenbank
class Berechnungen:
def __init__(self, a, b):
def __init__(self, a: float, b: float) -> None:
self.a_wert = a
self.b_wert = b
self.e_quadrat_wert = self.e_quadrat()
self.e_strich_quadrat_wert = self.e_strich_quadrat()
def e_quadrat(self):
def e_quadrat(self) -> float:
return (self.a_wert**2 - self.b_wert**2) / self.a_wert **2
def e_strich_quadrat(self):
def e_strich_quadrat(self) -> float:
return (self.a_wert**2 - self.b_wert**2) / self.b_wert **2
def P(self, x, y):
def P(self, x: float, y: float) -> float:
return np.sqrt(x**2 + y**2)
def hilfswinkel(self, x, y, z):
def hilfswinkel(self, x: float, y: float, z: float) -> float:
hw = np.atan2(z * self.a_wert, self.P(x, y) * self.b_wert)
return hw
def B(self, x, y, z):
def B(self, x: float, y: float, z: float) -> float:
hilfswinkel = self.hilfswinkel(x, y, z)
B = np.atan2((z + self.e_strich_quadrat_wert * self.b_wert * np.sin(hilfswinkel) ** 3), (self.P(x, y) - self.e_quadrat_wert * self.a_wert * np.cos(hilfswinkel) ** 3))
return B
def L(self, x, y):
def L(self, x: float, y: float) -> float:
return np.atan2(y, x)
def H(self, x, y, z):
def H(self, x: float, y: float, z: float) -> float:
B = self.B(x, y, z)
H = (self.P(x, y) / np.cos(B)) - self.a_wert / (np.sqrt(1 - self.e_quadrat_wert * np.sin(B) ** 2))
return H
def E(self, L, dX, dY):
def E(self, L: float, dX: float, dY: float) -> float:
E = -np.sin(L) * dX + np.cos(L) * dY
return E
def N(self, B, L, dX, dY, dZ):
def N(self, B: float, L: float, dX: float, dY: float, dZ: float) -> float:
N = -np.sin(B) * np.cos(L) * dX - np.sin(B) * np.sin(L) * dY + np.cos(B) * dZ
return N
def U(self, B, L, dX, dY, dZ):
def U(self, B: float, L: float, dX: float, dY: float, dZ: float) -> float:
U = np.cos(B) * np.cos(L) * dX + np.cos(B) * np.sin(L) *dY + np.sin(B) * dZ
return U
def horizontalstrecke_ENU(self, E, N):
def horizontalstrecke_ENU(self, E: float, N: float) -> float:
s = np.sqrt(E**2 + N**2)
return s
def Zenitwinkel(self, horizontalstrecke_ENU, U):
def Zenitwinkel(self, horizontalstrecke_ENU: float, U: float) -> float:
zw = np.atan2(horizontalstrecke_ENU, U)
return zw
def Azimut(self, E, N):
def Azimut(self, E: float, N: float) -> float:
Azimut = np.atan2(E, N)
if Azimut < 0:
Azimut += 2 * np.pi
@@ -65,7 +69,7 @@ class Berechnungen:
Azimut -= 2 * np.pi
return Azimut
def Richtung(self, Azimut, Orientierung):
def Richtung(self, Azimut: float, Orientierung: float) -> float:
Richtung = Azimut - Orientierung
if Richtung < 0:
Richtung += 2 * np.pi
@@ -73,13 +77,13 @@ class Berechnungen:
Richtung -= 2 * np.pi
return Richtung
def geometrische_breite_laenge(self, dict_koordinaten):
def geometrische_breite_laenge(self, dict_koordinaten: dict) -> dict:
for punktnummer, matrix in dict_koordinaten.items():
dict_koordinaten[punktnummer] = [matrix, self.B(matrix[0], matrix[1], matrix[2]), self.L(matrix[0], matrix[1])]
return dict_koordinaten
def berechnung_richtung_azimut_zenitwinkel(self, pfad_datenbank, dict_koordinaten):
def berechnung_richtung_azimut_zenitwinkel(self, pfad_datenbank: str, dict_koordinaten: dict) -> tuple[list[Any], dict[Any, Any]]:
dict_koordinaten_erweitert = {}
dict_orientierungen = {}
liste_azimut_richtungen = []
@@ -145,29 +149,29 @@ class Berechnungen:
class Einheitenumrechnung:
def __init__(self):
def __init__(self) -> None:
pass
def mas_to_rad(mas):
def mas_to_rad(mas: float) -> float:
umrechnungsfaktor = 1 / 1000 * 1 / 3600 * sp.pi / 180
grad = mas * umrechnungsfaktor
return grad
def mm_to_m(mm):
def mm_to_m(mm: float) -> float:
m = mm / 1000
return m
def ppb(ppb):
def ppb(ppb: float) -> float:
ppb *= 10 ** (-9)
return ppb
def gon_to_rad_Decimal(gon):
def gon_to_rad_Decimal(gon: float) -> float:
gon = Decimal(gon)
pi = Decimal(str(math.pi))
rad = (gon / Decimal(200)) * pi
return rad
def mgon_to_rad_Decimal(gon):
def mgon_to_rad_Decimal(gon: float) -> float:
gon = Decimal(gon)
pi = Decimal(str(math.pi))
rad = (gon / Decimal(200000)) * pi