From 6f7be5fef9093467a56def4b7488257100e7bb58 Mon Sep 17 00:00:00 2001 From: helplessThor <66440538+helplessThor@users.noreply.github.com> Date: Mon, 19 Oct 2020 21:07:46 +0530 Subject: [PATCH 01/13] Create degreeToRadFunc.py --- mathgenerator/funcs/degreeToRadFunc.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 mathgenerator/funcs/degreeToRadFunc.py diff --git a/mathgenerator/funcs/degreeToRadFunc.py b/mathgenerator/funcs/degreeToRadFunc.py new file mode 100644 index 0000000..3d1cb43 --- /dev/null +++ b/mathgenerator/funcs/degreeToRadFunc.py @@ -0,0 +1,11 @@ +from .__init__ import * +from numpy import pi + +def degreeToRadFunc(max_deg=360): + a = random.randint(0, max_deg) + b = (pi*a)/180 + + problem = "Angle " + str(a) + " in radians is = " + solution = str(b) + + return problem, solution From 57c731ad2540229829b55de99857abea257c8790 Mon Sep 17 00:00:00 2001 From: helplessThor <66440538+helplessThor@users.noreply.github.com> Date: Mon, 19 Oct 2020 21:08:56 +0530 Subject: [PATCH 02/13] Update __init__.py --- mathgenerator/funcs/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mathgenerator/funcs/__init__.py b/mathgenerator/funcs/__init__.py index fb8def9..9b46c3a 100644 --- a/mathgenerator/funcs/__init__.py +++ b/mathgenerator/funcs/__init__.py @@ -81,3 +81,4 @@ from .sectorAreaFunc import* from .meanMedianFunc import* from .determinantToMatrix22 import * from .deciToHexaFunc import * +from .degreeToRadFunc import * From b2e7baa3431e324582e6f4ada237dd7bc0112111 Mon Sep 17 00:00:00 2001 From: helplessThor <66440538+helplessThor@users.noreply.github.com> Date: Mon, 19 Oct 2020 21:09:49 +0530 Subject: [PATCH 03/13] Update mathgen.py added generator --- mathgenerator/mathgen.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mathgenerator/mathgen.py b/mathgenerator/mathgen.py index 9f570cc..b380459 100644 --- a/mathgenerator/mathgen.py +++ b/mathgenerator/mathgen.py @@ -114,3 +114,4 @@ meanMedian=Generator("Mean and Median", 76,"Mean and median of given set of numb intMatrix22determinant = Generator("Determinant to 2x2 Matrix", 77, "Det([[a,b],[c,d]]) =", " a * d - b * c", determinantToMatrix22) compoundInterest = Generator("Compound Interest", 78, "Compound interest for a principle amount of p dollars, r% rate of interest and for a time period of t years with n times compounded annually is = ", "A dollars", compoundInterestFunc) decimalToHexadeci = Generator("Decimal to Hexadecimal", 79,"Binary of a=", "b", deciToHexaFunc) +degreeToRad = Generator("Degrees to Radians", 85, "Angle a in radians is = ", "b", degreeToRadFunc) From a0076134241f0de25a4ab9cfc18ac913a9eb9599 Mon Sep 17 00:00:00 2001 From: helplessThor <66440538+helplessThor@users.noreply.github.com> Date: Tue, 20 Oct 2020 00:32:02 +0530 Subject: [PATCH 04/13] Create radianToDegFunc.py Radian to Degree Conversion function created --- mathgenerator/funcs/radianToDegFunc.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 mathgenerator/funcs/radianToDegFunc.py diff --git a/mathgenerator/funcs/radianToDegFunc.py b/mathgenerator/funcs/radianToDegFunc.py new file mode 100644 index 0000000..ce08cf3 --- /dev/null +++ b/mathgenerator/funcs/radianToDegFunc.py @@ -0,0 +1,12 @@ +from .__init__ import * +from numpy import pi + +def degreeToRadFunc(max_rad=pi): + a = random.randint(0, max_rad) + b = (180*a)/pi + b = round(b, 2) + + problem = "Angle " + str(a) + " in degrees is = " + solution = str(b) + + return problem, solution From e9a498be4fc0e756897ca3b8456d24e4b5642c6a Mon Sep 17 00:00:00 2001 From: helplessThor <66440538+helplessThor@users.noreply.github.com> Date: Tue, 20 Oct 2020 00:32:46 +0530 Subject: [PATCH 05/13] Update __init__.py Updated init --- mathgenerator/funcs/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mathgenerator/funcs/__init__.py b/mathgenerator/funcs/__init__.py index 9b46c3a..5a14293 100644 --- a/mathgenerator/funcs/__init__.py +++ b/mathgenerator/funcs/__init__.py @@ -82,3 +82,4 @@ from .meanMedianFunc import* from .determinantToMatrix22 import * from .deciToHexaFunc import * from .degreeToRadFunc import * +from .radianToDegFunc import * From f9f902e0fd5123a74a5ca1ec5b6188225a3db2c7 Mon Sep 17 00:00:00 2001 From: helplessThor <66440538+helplessThor@users.noreply.github.com> Date: Tue, 20 Oct 2020 00:34:41 +0530 Subject: [PATCH 06/13] Update mathgen.py update mathgen with generator class --- mathgenerator/mathgen.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mathgenerator/mathgen.py b/mathgenerator/mathgen.py index b380459..2fdc3be 100644 --- a/mathgenerator/mathgen.py +++ b/mathgenerator/mathgen.py @@ -115,3 +115,4 @@ intMatrix22determinant = Generator("Determinant to 2x2 Matrix", 77, "Det([[a,b], compoundInterest = Generator("Compound Interest", 78, "Compound interest for a principle amount of p dollars, r% rate of interest and for a time period of t years with n times compounded annually is = ", "A dollars", compoundInterestFunc) decimalToHexadeci = Generator("Decimal to Hexadecimal", 79,"Binary of a=", "b", deciToHexaFunc) degreeToRad = Generator("Degrees to Radians", 85, "Angle a in radians is = ", "b", degreeToRadFunc) +radianToDeg = Generator("Radians to Degrees", 100, "Angle a in degrees is = ", "b", radianToDegFunc) From 974695388f0e79555b43e2ef19f008c768fba96b Mon Sep 17 00:00:00 2001 From: helplessThor <66440538+helplessThor@users.noreply.github.com> Date: Tue, 20 Oct 2020 00:35:48 +0530 Subject: [PATCH 07/13] Update degreeToRadFunc.py Added 2 decimal point round off in solution --- mathgenerator/funcs/degreeToRadFunc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mathgenerator/funcs/degreeToRadFunc.py b/mathgenerator/funcs/degreeToRadFunc.py index 3d1cb43..0f4da2e 100644 --- a/mathgenerator/funcs/degreeToRadFunc.py +++ b/mathgenerator/funcs/degreeToRadFunc.py @@ -4,6 +4,7 @@ from numpy import pi def degreeToRadFunc(max_deg=360): a = random.randint(0, max_deg) b = (pi*a)/180 + b = round(b, 2) problem = "Angle " + str(a) + " in radians is = " solution = str(b) From a37d49e877cedb1fe01caab01f282701ce3460ba Mon Sep 17 00:00:00 2001 From: helplessThor <66440538+helplessThor@users.noreply.github.com> Date: Tue, 20 Oct 2020 01:20:08 +0530 Subject: [PATCH 08/13] Update __init__.py resolved conflicts --- mathgenerator/funcs/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mathgenerator/funcs/__init__.py b/mathgenerator/funcs/__init__.py index 5a14293..31ad609 100644 --- a/mathgenerator/funcs/__init__.py +++ b/mathgenerator/funcs/__init__.py @@ -81,5 +81,7 @@ from .sectorAreaFunc import* from .meanMedianFunc import* from .determinantToMatrix22 import * from .deciToHexaFunc import * +from .percentageFunc import * +from .celsiustofahrenheit import * from .degreeToRadFunc import * from .radianToDegFunc import * From 079627622829594ebdc8d4838d103815cbbbfa3d Mon Sep 17 00:00:00 2001 From: Luke Weiler Date: Mon, 19 Oct 2020 21:26:17 -0400 Subject: [PATCH 09/13] Update degreeToRadFunc.py --- mathgenerator/funcs/degreeToRadFunc.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mathgenerator/funcs/degreeToRadFunc.py b/mathgenerator/funcs/degreeToRadFunc.py index 0f4da2e..96ec12b 100644 --- a/mathgenerator/funcs/degreeToRadFunc.py +++ b/mathgenerator/funcs/degreeToRadFunc.py @@ -10,3 +10,6 @@ def degreeToRadFunc(max_deg=360): solution = str(b) return problem, solution + + +degreeToRad = Generator("Degrees to Radians", 86, "Angle a in radians is = ", "b", degreeToRadFunc) From cca6f16b6295534411bf8bc6ac6f7fa7995a6147 Mon Sep 17 00:00:00 2001 From: Luke Weiler Date: Mon, 19 Oct 2020 21:26:36 -0400 Subject: [PATCH 10/13] Update radianToDegFunc.py --- mathgenerator/funcs/radianToDegFunc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mathgenerator/funcs/radianToDegFunc.py b/mathgenerator/funcs/radianToDegFunc.py index ce08cf3..1021a60 100644 --- a/mathgenerator/funcs/radianToDegFunc.py +++ b/mathgenerator/funcs/radianToDegFunc.py @@ -10,3 +10,5 @@ def degreeToRadFunc(max_rad=pi): solution = str(b) return problem, solution + +radianToDeg = Generator("Radians to Degrees", 87, "Angle a in degrees is = ", "b", radianToDegFunc) From ce131477a71bb999dda3f49ec723af8a018751c6 Mon Sep 17 00:00:00 2001 From: Luke Weiler Date: Mon, 19 Oct 2020 21:28:15 -0400 Subject: [PATCH 11/13] Linter fix --- mathgenerator/funcs/degreeToRadFunc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mathgenerator/funcs/degreeToRadFunc.py b/mathgenerator/funcs/degreeToRadFunc.py index 96ec12b..7ca4080 100644 --- a/mathgenerator/funcs/degreeToRadFunc.py +++ b/mathgenerator/funcs/degreeToRadFunc.py @@ -1,9 +1,10 @@ from .__init__ import * from numpy import pi + def degreeToRadFunc(max_deg=360): a = random.randint(0, max_deg) - b = (pi*a)/180 + b = (pi * a) / 180 b = round(b, 2) problem = "Angle " + str(a) + " in radians is = " From 742a2ff4d3c50b0487580ad7aa4281a148c71347 Mon Sep 17 00:00:00 2001 From: Luke Weiler Date: Mon, 19 Oct 2020 21:28:42 -0400 Subject: [PATCH 12/13] linter fix --- mathgenerator/funcs/radianToDegFunc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mathgenerator/funcs/radianToDegFunc.py b/mathgenerator/funcs/radianToDegFunc.py index 1021a60..05285a8 100644 --- a/mathgenerator/funcs/radianToDegFunc.py +++ b/mathgenerator/funcs/radianToDegFunc.py @@ -1,9 +1,10 @@ from .__init__ import * from numpy import pi + def degreeToRadFunc(max_rad=pi): a = random.randint(0, max_rad) - b = (180*a)/pi + b = (180 * a) / pi b = round(b, 2) problem = "Angle " + str(a) + " in degrees is = " @@ -11,4 +12,5 @@ def degreeToRadFunc(max_rad=pi): return problem, solution + radianToDeg = Generator("Radians to Degrees", 87, "Angle a in degrees is = ", "b", radianToDegFunc) From 238a82587412a62a3dd93d4966b8210f12d51a5b Mon Sep 17 00:00:00 2001 From: Luke Weiler Date: Mon, 19 Oct 2020 21:30:15 -0400 Subject: [PATCH 13/13] Linter fix --- mathgenerator/mathgen.py | 1 - 1 file changed, 1 deletion(-) diff --git a/mathgenerator/mathgen.py b/mathgenerator/mathgen.py index c455b41..959093b 100644 --- a/mathgenerator/mathgen.py +++ b/mathgenerator/mathgen.py @@ -35,4 +35,3 @@ def genById(id): # Format is: # = Generator("<Title>", <id>, <generalized problem>, <generalized solution>, <function name>) -