mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
15 lines
526 B
Python
15 lines
526 B
Python
from .__init__ import *
|
|
|
|
|
|
def distanceTwoPointsFunc(maxValXY=20, minValXY=-20):
|
|
point1X = random.randint(minValXY, maxValXY + 1)
|
|
point1Y = random.randint(minValXY, maxValXY + 1)
|
|
point2X = random.randint(minValXY, maxValXY + 1)
|
|
point2Y = random.randint(minValXY, maxValXY + 1)
|
|
|
|
distanceSq = (point1X - point2X) ** 2 + (point1Y - point2Y) ** 2
|
|
|
|
solution = f"sqrt({distanceSq})"
|
|
problem = f"Find the distance between ({point1X}, {point1Y}) and ({point2X}, {point2Y})"
|
|
return problem, solution
|