multiply complex numbers

issue number #75
This commit is contained in:
razinc
2020-10-16 22:43:40 +08:00
committed by GitHub
parent 56009dabf8
commit c4f21014d0

View File

@@ -339,6 +339,13 @@ def distanceTwoPointsFunc(maxValXY = 20, minValXY=-20):
problem = f"Find the distance between ({point1X}, {point1Y}) and ({point2X}, {point2Y})" problem = f"Find the distance between ({point1X}, {point1Y}) and ({point2X}, {point2Y})"
return problem, solution return problem, solution
def multiplyComplexNumbersFunc(minRealImaginaryNum = -20, maxRealImaginaryNum = 20):
num1 = complex(random.randint(minRealImaginaryNum, maxRealImaginaryNum), random.randint(minRealImaginaryNum, maxRealImaginaryNum))
num2 = complex(random.randint(minRealImaginaryNum, maxRealImaginaryNum), random.randint(minRealImaginaryNum, maxRealImaginaryNum))
problem = f"{num1} * {num2} = "
solution = num1 * num2
return problem, solution
# || Class Instances # || Class Instances
#Format is: #Format is:
@@ -368,4 +375,5 @@ factoring = Generator("Subtraction", 21, "x^2+(x1+x2)+x1*x2", "(x-x1)(x-x2)", fa
thirdAngleOfTriangle = Generator("Third Angle of Triangle", 22, "Third Angle of the triangle = ", "angle3", thirdAngleOfTriangleFunc) thirdAngleOfTriangle = Generator("Third Angle of Triangle", 22, "Third Angle of the triangle = ", "angle3", thirdAngleOfTriangleFunc)
systemOfEquations = Generator("Solve a System of Equations in R^2", 23, "2x + 5y = 13, -3x - 3y = -6", "x = -1, y = 3", systemOfEquations = Generator("Solve a System of Equations in R^2", 23, "2x + 5y = 13, -3x - 3y = -6", "x = -1, y = 3",
systemOfEquationsFunc) systemOfEquationsFunc)
distance2Point = Generator("Distance between 2 points", 24, "Find the distance between (x1,y1) and (x2,y2)","sqrt(distanceSquared)", distanceTwoPointsFunc) distance2Point = Generator("Distance between 2 points", 24, "Find the distance between (x1,y1) and (x2,y2)","sqrt(distanceSquared)", distanceTwoPointsFunc)
ComplexNumMultiply = Generator("Multiplication of 2 complex numbers", 25, "(x + j) (y + j) = ", "xy + xj + yj -1", multiplyComplexNumbersFunc)