Files
Masterprojekt/hausarbeit.py
2025-10-15 12:52:17 +02:00

79 lines
3.0 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from numpy import cos, sin, tan
import winkelumrechnungen as wu
import s_ellipse as s_ell
import ausgaben as aus
from ellipsoide import EllipsoidBiaxial
import Numerische_Integration.num_int_runge_kutta as rk
import GHA.gauss as gauss
import GHA.bessel as bessel
matrikelnummer = "6044051"
print(f"Matrikelnummer: {matrikelnummer}")
m4 = matrikelnummer[-4]
m3 = matrikelnummer[-3]
m2 = matrikelnummer[-2]
m1 = matrikelnummer[-1]
print(f"m1={m1}\tm2={m2}\tm3={m3}\tm4={m4}")
re = EllipsoidBiaxial.init_name("Bessel")
nks = 3
print(f"\na = {re.a} m\nb = {re.b} m\nc = {re.c} m\ne' = {re.e_}")
print("\n\nAufgabe 1 (via Reihenentwicklung)")
phi1 = re.beta2phi(wu.gms2rad([int("1"+m1), int("1"+m2), int("1"+m3)]))
print(f"{aus.gms('phi_P1', phi1, 5)}")
s = s_ell.reihenentwicklung(re.e_, re.c, phi1)
print(f'\ns_P1 = {round(s,nks)} m')
# s_poly = s_ell.polyapp_tscheby_bessel(phi1)
# print(f'Meridianbogenlänge: {round(s_poly,nks)} m (Polynomapproximation)')
print("\n\nAufgabe 2 (via Gauß´schen Mittelbreitenformeln)")
lambda1 = wu.gms2rad([int("1"+m3), int("1"+m2), int("1"+m4)])
A12 = wu.gms2rad([90, 0, 0])
s12 = float("1"+m4+m3+m2+"."+m1+"0")
# print("\nvia Runge-Kutta-Verfahren")
# re = Ellipsoid.init_name("Bessel")
# f_phi = lambda s, phi, lam, A: cos(A) * re.V(phi) ** 3 / re.c
# f_lam = lambda s, phi, lam, A: sin(A) * re.V(phi) / (cos(phi) * re.c)
# f_A = lambda s, phi, lam, A: tan(phi) * sin(A) * re.V(phi) / re.c
#
# funktionswerte = rk.verfahren([f_phi, f_lam, f_A],
# [0, phi1, lambda1, A12],
# s12, 1)
#
# for s, phi, lam, A in funktionswerte:
# print(f"{s} m, {aus.gms('phi', phi, nks)}, {aus.gms('lambda', lam, nks)}, {aus.gms('A', A, nks)}")
# print("via Gauß´schen Mittelbreitenformeln")
phi_p2, lambda_p2, A_p2 = gauss.gha1(EllipsoidBiaxial.init_name("Bessel"),
phi_p1=phi1,
lambda_p1=lambda1,
A_p1=A12,
s=s12, eps=wu.gms2rad([1*10**-8, 0, 00]))
print(f"\nP2: {aus.gms('phi', phi_p2[-1], nks)}\t\t{aus.gms('lambda', lambda_p2[-1], nks)}\t{aus.gms('A', A_p2[-1], nks)}")
# print("\nvia Verfahren nach Bessel")
# phi_p2, lambda_p2, A_p2 = bessel.gha1(Ellipsoid.init_name("Bessel"),
# phi_p1=phi1,
# lambda_p1=lambda1,
# A_p1=A12,
# s=s12)
# print(f"P2: {aus.gms('phi', phi_p2, nks)}, {aus.gms('lambda', lambda_p2, nks)}, {aus.gms('A', A_p2, nks)}")
print("\n\nAufgabe 3")
p = re.phi2p(phi_p2[-1])
print(f"p = {round(p,2)} m")
print("\n\nAufgabe 4")
x = float("4308"+m3+"94.556")
y = float("1214"+m2+"88.242")
z = float("4529"+m4+"03.878")
phi_p3, lambda_p3, h_p3 = re.ellipsoidische_Koords(0.001, wu.gms2rad([0, 0, 0.001]), x, y, z)
print(f"\nP3: {aus.gms('phi', phi_p3, nks)}, {aus.gms('lambda', lambda_p3, 5)}, h = {round(h_p3,nks)} m")