Skip to content

Latest commit

 

History

History
39 lines (24 loc) · 735 Bytes

README.md

File metadata and controls

39 lines (24 loc) · 735 Bytes

Polar Coordinates

https://www.hackerrank.com/challenges/polar-coordinates

Problem

Polar coordinates are an alternative way of representing Cartesian coordinates or Complex Numbers.

Task

You are given a complex z. Your task is to convert it to polar coordinates.

Input Format

A single line containing the complex number z. Note: complex() function can be used in python to convert the input as a complex number.

Output Format

Output two lines: The first line should contain the value of r. The second line should contain the value of phi.

Sample Input 0

1+2j

Sample Output 0

2.23606797749979 
1.1071487177940904

My Solution