I am attempting to create a function that can find the distance between a pair of points. Imagine I was walking or driving on a (x,y) plane and I started at the point (1,1) and ended up at (4,7). In general, it could be any 2 pairs of points..
Here is what I have come up with thus far...
Clear[x1, x2, y2, y1,distance list];
list = {{x1_, x2_}, {y1_, y2_}};
distance[list] = Abs[(x2 - x1) + (y2 - y1)];
distance[{2, 1}, {3, 4}]
Do I have to explicitly define my list as a pair of points, like (1,1) and (4,7)? Why cant I define it as the way I have it with the x1,x2 and y1,y2?? Then at the very end I could plug in any pair of points for the distance function I created.. Unless I have a syntax error, or maybe I don't have something define correctly.
Any suggestions is greatly appreciated!
B