Meine alten Sachen aus RALV
This commit is contained in:
27
ausgaben.py
Normal file
27
ausgaben.py
Normal 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}''"
|
||||
Reference in New Issue
Block a user