From 7502278b4a3c11a0018e71143e5797e0bf9b55dd Mon Sep 17 00:00:00 2001 From: ee17b031-iittp Date: Sun, 25 Oct 2020 16:03:17 +0530 Subject: [PATCH 1/3] "added arc_length" --- README.md | 1 + mathgenerator/funcs/__init__.py | 1 + mathgenerator/funcs/arc_length.py | 14 ++++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 mathgenerator/funcs/arc_length.py diff --git a/README.md b/README.md index 4ed2096..126b7ad 100644 --- a/README.md +++ b/README.md @@ -138,3 +138,4 @@ problem, solution = mathgen.genById(0) | 104 | Circumference | Circumference of circle with radius 60 | 376.99111843077515 | circumference | | 105 | Combine Like terms | 4x^4 + 6x^4 + 9x^1 + 3x^1 + 5x^4 + 10x^3 | 12x^1 + 10x^3 + 15x^4 | combine_like_terms | | 105 | Conditional Probability | Someone tested positive for a nasty disease which only 1.34% of population have. Test sensitivity (true positive) is equal to SN= 98.05% whereas test specificity (true negative) SP= 92.32%. What is the probability that this guy really has that disease? | 14.78% | conditional_probability | +| 106 | Arc Length of an Angle | arc length of an angle with radius = 4.5m and angle = 45 | 3.5357142 | arc_length | \ No newline at end of file diff --git a/mathgenerator/funcs/__init__.py b/mathgenerator/funcs/__init__.py index 575dcd2..331db5f 100644 --- a/mathgenerator/funcs/__init__.py +++ b/mathgenerator/funcs/__init__.py @@ -111,3 +111,4 @@ from .decimal_to_bcd import * from .circumference import * from .combine_like_terms import * from .conditional_probability import * +from .arc_length import * \ No newline at end of file diff --git a/mathgenerator/funcs/arc_length.py b/mathgenerator/funcs/arc_length.py new file mode 100644 index 0000000..4e3c536 --- /dev/null +++ b/mathgenerator/funcs/arc_length.py @@ -0,0 +1,14 @@ +from .__init__ import * + + +def arclengthFunc(maxRadius=49, maxAngle=359): + Radius = random.randint(1, maxRadius) + Angle = random.randint(1, maxAngle) + problem = f"Given radius, {Radius} and angle, {Angle}. Find the arc length of the angle." + angle_arc_length = float((Angle / 360) * 2 * math.pi * Radius) + formatted_float = "{:.5f}".format(angle_arc_length) + solution = f"Arc length of the angle = {formatted_float}" + return problem, solution + + +arc_length = Generator("Arc length of Angle", 106, " Given the radius, r and angle, ang. Calculate the arc length of the given angle", "(ang/360) * 2 * pi * r", arclengthFunc) \ No newline at end of file From d88198ad12632c4e2ed4b0825201827c1ca8ac09 Mon Sep 17 00:00:00 2001 From: ee17b031-iittp Date: Sun, 25 Oct 2020 16:41:49 +0530 Subject: [PATCH 2/3] "added arc_length" --- README.md | 2 +- mathgenerator/funcs/arc_length.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 126b7ad..d179b37 100644 --- a/README.md +++ b/README.md @@ -138,4 +138,4 @@ problem, solution = mathgen.genById(0) | 104 | Circumference | Circumference of circle with radius 60 | 376.99111843077515 | circumference | | 105 | Combine Like terms | 4x^4 + 6x^4 + 9x^1 + 3x^1 + 5x^4 + 10x^3 | 12x^1 + 10x^3 + 15x^4 | combine_like_terms | | 105 | Conditional Probability | Someone tested positive for a nasty disease which only 1.34% of population have. Test sensitivity (true positive) is equal to SN= 98.05% whereas test specificity (true negative) SP= 92.32%. What is the probability that this guy really has that disease? | 14.78% | conditional_probability | -| 106 | Arc Length of an Angle | arc length of an angle with radius = 4.5m and angle = 45 | 3.5357142 | arc_length | \ No newline at end of file +| 106 | Arc Length of an Angle | arc length of an angle with radius = 4.5m and angle = 45 | 3.5357142 | arc_length | diff --git a/mathgenerator/funcs/arc_length.py b/mathgenerator/funcs/arc_length.py index 4e3c536..3b18b52 100644 --- a/mathgenerator/funcs/arc_length.py +++ b/mathgenerator/funcs/arc_length.py @@ -11,4 +11,4 @@ def arclengthFunc(maxRadius=49, maxAngle=359): return problem, solution -arc_length = Generator("Arc length of Angle", 106, " Given the radius, r and angle, ang. Calculate the arc length of the given angle", "(ang/360) * 2 * pi * r", arclengthFunc) \ No newline at end of file +arc_length = Generator("Arc length of Angle", 106, " Given the radius, r and angle, ang. Calculate the arc length of the given angle", "(ang/360) * 2 * pi * r", arclengthFunc) From 39e49b282b757e2cdc29612421f8ff8a8ab7bfdb Mon Sep 17 00:00:00 2001 From: ee17b031-iittp Date: Sun, 25 Oct 2020 16:43:53 +0530 Subject: [PATCH 3/3] "added arc_length" --- mathgenerator/funcs/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mathgenerator/funcs/__init__.py b/mathgenerator/funcs/__init__.py index 331db5f..7941dcc 100644 --- a/mathgenerator/funcs/__init__.py +++ b/mathgenerator/funcs/__init__.py @@ -111,4 +111,4 @@ from .decimal_to_bcd import * from .circumference import * from .combine_like_terms import * from .conditional_probability import * -from .arc_length import * \ No newline at end of file +from .arc_length import *