1 function d = plist_distance(plist, id1, id2)
2 %% function d = distance(pl, id1, id2)
3 %% computes distance between two points id1 and id2
4 %% the distance is horizonthal -- x,y coodrinates are used
7 usage('d = plist_distance(plist, id1, id2)')
10 if ( !isplist(plist) )
11 error('plist_distance: The first parameter is not plist')
14 [tst, id1, id2] = common_id(id1, id2);
16 error('plist_distance: Argument id1 or id2 are not ids of points.')
19 [x1, y1] = coordxy(plist, id1);
20 [x2, y2] = coordxy(plist, id2);
21 d = sqrt((x2-x1).^2 + (y2-y1).^2);