hbui
2024-07-15 64d8e5c62ef049057ecfabdb232caa7e775547b0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#! /usr/bin/env python
import sys
import math
 
 
x = float(sys.argv[1])
y = float(sys.argv[2])
 
z = complex(x, y)
radius = abs(z)
theta = math.atan2(y, x)
theta_degree = math.degrees(theta)
 
print("Kartesische Koordinate des Punktes:")
print(f"   x = {x}; y = {y}")
print(f"   r = {radius:.3f}; theta = {theta_degree:.3f}°")