We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
importmathif__name__=='__main__':num=complex(input())x=num.realy=num.imagr=math.dist([0,0],[x,y])#Distancefromztotheorigin# Alternatively, r can be obtained using math.sqrt(x**2 + y**2)phase=math.atan2(y,x)#Thetaprint(r,phase,sep='\n')
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Polar Coordinates
You are viewing a single comment's thread. Return to all comments →
I used math cuz I dont like cmath