mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 14:35:23 +01:00
Merge pull request #319 from ee17b031-iittp/master
Created a generator for arc length
This commit is contained in:
@@ -112,3 +112,4 @@ from .circumference import *
|
|||||||
from .combine_like_terms import *
|
from .combine_like_terms import *
|
||||||
from .signum_function import *
|
from .signum_function import *
|
||||||
from .conditional_probability import *
|
from .conditional_probability import *
|
||||||
|
from .arc_length import *
|
||||||
|
|||||||
14
mathgenerator/funcs/arc_length.py
Normal file
14
mathgenerator/funcs/arc_length.py
Normal file
@@ -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)
|
||||||
Reference in New Issue
Block a user