-->
当前位置:首页 > 题库

PROGRAMMING:Cartesian coordinates → polar coordinates

Luz5年前 (2021-05-10)题库390
Please write a program to input Cartesian coordinates of the point ($$x $$, $$y $$) and output polar coordinates ($$R $$, $$theta $$).
####Input format
>$$x $$and $$Y$$
####Output format
>$$R $$and $$theta$$
requirement:
-The unit of $$- theta $$is radian, and $$- - pi / Leq / theta / Leq / PI $$.
-$$R $$, $$theta $$all output 4 decimal places (rounded to the last place).
####Input sample
```in
0.9 1.2
```
####Output sample
```out
1.5000 0.9273
```
Tip: use atan2 function to find polar angle.







answer:If there is no answer, please comment