First, I calculated the Euclidean distance then I tried to iterated using loop to go to certain point using slope but the moving path doesn't like a straight line. Please help me to slove.
def move(roborect,grad):
power=(x_cord[0]-roborect.x)**2+(y_cord[0]-roborect.y)**2
distance=math.sqrt(power)
if(distance>15):
roborect.y=int(grad*roborect.x)+roborect.y
roborect.x=roborect.x+5
print(distance)