Hong-Phuc Bui
2024-06-17 689ada49c2f083fcb3a2eeafc2ac15954ed64eca
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}°")