File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 169
169
* [ Prefix Conversions] ( conversions/prefix_conversions.py )
170
170
* [ Prefix Conversions String] ( conversions/prefix_conversions_string.py )
171
171
* [ Pressure Conversions] ( conversions/pressure_conversions.py )
172
- * [ Rec To Pol] ( conversions/rec_to_pol.py )
173
172
* [ Rgb Cmyk Conversion] ( conversions/rgb_cmyk_conversion.py )
174
173
* [ Rgb Hsv Conversion] ( conversions/rgb_hsv_conversion.py )
175
174
* [ Roman Numerals] ( conversions/roman_numerals.py )
Original file line number Diff line number Diff line change 1
- import doctest
2
1
import math
3
2
4
3
5
- def rec_to_pol (real : float , img : float ) -> tuple :
4
+ def rectangular_to_polar (real : float , img : float ) -> tuple [ float , float ] :
6
5
"""
7
6
https://en.wikipedia.org/wiki/Polar_coordinate_system
8
7
@@ -20,7 +19,6 @@ def rec_to_pol(real: float, img: float) -> tuple:
20
19
(11.41, 31.31)
21
20
>>> rec_to_pol(10000,99999)
22
21
(100497.76, 84.29)
23
-
24
22
"""
25
23
26
24
mod = round (math .sqrt ((real ** 2 ) + (img ** 2 )), 2 )
@@ -30,4 +28,6 @@ def rec_to_pol(real: float, img: float) -> tuple:
30
28
31
29
32
30
if __name__ == "__main__" :
31
+ import doctest
32
+
33
33
doctest .testmod ()
You can’t perform that action at this time.
0 commit comments