Files
mathgenerator/mathgenerator/funcs/sectorAreaFunc.py
2020-10-19 20:33:18 -04:00

18 lines
638 B
Python

from .__init__ import *
from ..__init__ import Generator
def sectorAreaFunc(maxRadius=49, maxAngle=359):
Radius = random.randint(1, maxRadius)
Angle = random.randint(1, maxAngle)
problem = f"Given radius, {Radius} and angle, {Angle}. Find the area of the sector."
secArea = float((Angle / 360) * math.pi * Radius * Radius)
formatted_float = "{:.5f}".format(secArea)
solution = f"Area of sector = {formatted_float}"
return problem, solution
sectorArea = Generator("Area of a Sector", 75,
"Area of a sector with radius, r and angle, a ", "Area",
sectorAreaFunc)