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 169169 * [ Prefix Conversions] ( conversions/prefix_conversions.py )
170170 * [ Prefix Conversions String] ( conversions/prefix_conversions_string.py )
171171 * [ Pressure Conversions] ( conversions/pressure_conversions.py )
172- * [ Rec To Pol] ( conversions/rec_to_pol.py )
173172 * [ Rgb Cmyk Conversion] ( conversions/rgb_cmyk_conversion.py )
174173 * [ Rgb Hsv Conversion] ( conversions/rgb_hsv_conversion.py )
175174 * [ Roman Numerals] ( conversions/roman_numerals.py )
Original file line number Diff line number Diff line change 1- import doctest
21import math
32
43
5- def rec_to_pol (real : float , img : float ) -> tuple :
4+ def rectangular_to_polar (real : float , img : float ) -> tuple [ float , float ] :
65 """
76 https://en.wikipedia.org/wiki/Polar_coordinate_system
87
@@ -20,7 +19,6 @@ def rec_to_pol(real: float, img: float) -> tuple:
2019 (11.41, 31.31)
2120 >>> rec_to_pol(10000,99999)
2221 (100497.76, 84.29)
23-
2422 """
2523
2624 mod = round (math .sqrt ((real ** 2 ) + (img ** 2 )), 2 )
@@ -30,4 +28,6 @@ def rec_to_pol(real: float, img: float) -> tuple:
3028
3129
3230if __name__ == "__main__" :
31+ import doctest
32+
3333 doctest .testmod ()
You can’t perform that action at this time.
0 commit comments