Meine alten Sachen aus RALV

This commit is contained in:
2025-10-15 11:32:56 +02:00
commit c89b932d55
17 changed files with 763 additions and 0 deletions

27
ausgaben.py Normal file
View File

@@ -0,0 +1,27 @@
import winkelumrechnungen as wu
def xyz(x: float, y: float, z: float, stellen: int) -> str:
"""
Erzeugen eines mehrzeiligen Strings zur Ausgabe von Koordinaten.
:param x: x-Koordinate
:param y: y-Koordinate
:param z: z-Koordinate
:param stellen: Anzahl Nachkommastellen
:return: String zur Ausgabe der Koordinaten
"""
return f"""x = {(round(x,stellen))} m
y = {(round(y,stellen))} m
z = {(round(z,stellen))} m"""
def gms(name: str, rad: float, stellen: int) -> str:
"""
Erzeugen eines Strings zur Ausgabe eines Winkel in Grad-Minuten-Sekunden.
:param name: Bezeichnung des Winkels
:param rad: Winkel in Radiant
:param stellen: Anzahl Nachkommastellen
:return: String zur Ausgabe des Winkels
"""
gms = wu.rad2gms(rad)
return f"{name} = {int(gms[0])}° {int(gms[1])}' {round(gms[2],stellen):.{stellen}f}''"