I am trying to know equidistant points between two points. For example:
p1 = (1,1)
p2 = (5,5)
The answer that I am expecting is:
def getEquidistantPoints(p1, p2, HowManyParts):
#some code
return (array with points)
In this example, with p1
, and p2
:
A = getEquidistantPoints(p1,p2,4)
A = [(1,1),(2,2),(3,3),(4,4),(5,5)]
Always will be a straight line.
HowManyParts
in this case is the whole distance that is divided
something like numpy.linspace()
but in two dimensions.