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

@@ -72,4 +72,5 @@ from .geomProgrFunc import *
from .geometricMeanFunc import * from .geometricMeanFunc import *
from .harmonicMeanFunc import * from .harmonicMeanFunc import *
from .DegreeToRadian import * from .DegreeToRadian import *
from .DecimalToOctal 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

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