Files
mathgenerator/mathgenerator/funcs/MidPointOfTwoPointFunc.py
2020-10-19 13:54:31 -04:00

13 lines
339 B
Python

from .__init__ import *
def MidPointOfTwoPointFunc(maxValue=20):
x1 = random.randint(-20, maxValue)
y1 = random.randint(-20, maxValue)
x2 = random.randint(-20, maxValue)
y2 = random.randint(-20, maxValue)
problem = f"({x1},{y1}),({x2},{y2})="
solution = f"({(x1+x2)/2},{(y1+y2)/2})"
return problem, solution