I have two coordinates in a rectangular area -
currentPosition:
x1 = 100,
y1 =100
target:
x2 = 213,
y2 = 187
I need to calculate the shortest distance between the two coordinates using JavaScript (it can moves only in straight lines between the current position and the target).
Probably math formula is needed for the solution but I need help with it. Thanks.