This commit is contained in:
adit098
2020-10-19 22:29:03 +05:30
parent 57456ca1ad
commit 090afdd451
3 changed files with 17 additions and 2 deletions

View File

@@ -73,3 +73,4 @@ from .geometricMeanFunc import *
from .harmonicMeanFunc import *
from .DegreeToRadian import *
from .DecimalToOctal import *
from .complexToPolarFunc import *

View File

@@ -0,0 +1,13 @@
from .__init__ import *
def polar(minRealImaginaryNum = -20, maxRealImaginaryNum = 20):
num = complex(random.randint(minRealImaginaryNum, maxRealImaginaryNum), random.randint(minRealImaginaryNum, maxRealImaginaryNum))
a= num.real
b= num.imag
r = round(math.hypot(a,b), 2)
theta = round(math.atan2(b,a), 2)
plr = str(r) + "exp(i" + str(theta) + ")"
problem = f"rexp(itheta) = "
solution = plr
return problem, solution

View File

@@ -161,3 +161,4 @@ decimalToHexadecimal = Generator("Decimal to Hexadecimal", 68,
degreeToRadian = Generator("Degree To Radian", 69, "Radian of angle=", "radian", DegreeToRadian)
decimalToOctal = Generator("Decimal to Octal", 70,
"Octal of a=", "b", DecimalToOctalFunc)
complexToPolar = Generator("Complex To Polar Form", 71, "rexp(itheta) = ", "plr", complexToPolarFunc)