#To convert from cartesian co-ordinate to polar co-ordinate
x=input("Enter the value of X:")
y=input("Enter the value of Y:")
x=float(x)
y=float(y)
from math import *
r=sqrt(x**2+y**2)
angle=degrees(atan2(y,x))
print("The value of r is:",r)
print("The value of angle in degrees is:",angle)
x=input("Enter the value of X:")
y=input("Enter the value of Y:")
x=float(x)
y=float(y)
from math import *
r=sqrt(x**2+y**2)
angle=degrees(atan2(y,x))
print("The value of r is:",r)
print("The value of angle in degrees is:",angle)
Comments
Post a Comment