From 6ccb1a9bc7fa3bad872947be65f853136ba84928 Mon Sep 17 00:00:00 2001 From: Aditya Mahimkar Date: Fri, 16 Oct 2020 11:11:42 +0530 Subject: [PATCH] Update mathgen.py --- mathgenerator/mathgen.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mathgenerator/mathgen.py b/mathgenerator/mathgen.py index 9918cd0..7a7205e 100644 --- a/mathgenerator/mathgen.py +++ b/mathgenerator/mathgen.py @@ -276,6 +276,13 @@ def factoringFunc(range_x1 = 10, range_x2 = 10): solution = f"(x{x1})(x{x2})" return problem, solution +def thirdAngleOfTriangle(maxAngle=180): + angle1 = random.randint(1, maxAngle) + x1 = random.randint(1, maxAngle) + angle3 = 180 - (angle1 + angle2) + problem = "Third angle = " + + # || Class Instances #Format is: @@ -301,4 +308,4 @@ intMatrix22Multiplication = Generator("Integer Multiplication with 2x2 Matrix", areaOfTriangle = Generator("Area of Triangle", 18, "Area of Triangle with side lengths a, b, c = ", "area", areaOfTriangleFunc) doesTriangleExist = Generator("Triangle exists check", 19, "Does triangle with sides a, b and c exist?","Yes/No", isTriangleValidFunc) midPointOfTwoPoint=Generator("Midpoint of the two point", 20,"((X1,Y1),(X2,Y2))=","((X1+X2)/2,(Y1+Y2)/2)",MidPointOfTwoPointFunc) -factoring = Generator("Subtraction", 21, "x^2+(x1+x2)+x1*x2", "(x-x1)(x-x2)", factoringFunc) \ No newline at end of file +factoring = Generator("Subtraction", 21, "x^2+(x1+x2)+x1*x2", "(x-x1)(x-x2)", factoringFunc)