![]() |
Microscopy Image Browser 2.91
MIB
|
MINDISTANCEPOINTS Minimal distance between several points. More...
Functions | |
function varargout = | minDistancePoints (p1, varargin) |
MINDISTANCEPOINTS Minimal distance between several points. | |
function [ r , c ] = | minDistancePoints>ind2sub_tril (N, idx) |
MINDISTANCEPOINTS Minimal distance between several points.
function varargout = minDistancePoints | ( | p1, | |
varargin ) |
MINDISTANCEPOINTS Minimal distance between several points.
DIST = minDistancePoints(PTS) Returns the minimum distance between all couple of points in PTS. PTS is a N-by-D array of values, N being the number of points and D the dimension of the points.
DIST = minDistancePoints(PTS1, PTS2) Computes for each point in PTS1 the minimal distance to every point of PTS2. PTS1 and PTS2 are N-by-D arrays, where N is the number of points, and D is the dimension. Dimension must be the same for both arrays, but number of points can be different. The result is an array the same length as PTS1.
DIST = minDistancePoints(..., NORM) Uses a user-specified norm. NORM=2 means euclidean norm (the default), NORM=1 is the Manhattan (or "taxi-driver") distance. Increasing NORM growing up reduces the minimal distance, with a limit to the biggest coordinate difference among dimensions.
[DIST I J] = minDistancePoints(PTS) Returns indices I and J of the 2 points which are the closest. DIST
[DIST J] = minDistancePoints(PTS1, PTS2, ...) Also returns the indices of points which are the closest. J has the same size as DIST. It verifies relation: DIST(I) = distancePoints(PTS1(I,:), PTS2(J,:)); for I comprised between 1 and the number of rows in PTS1.
% minimal distance between random space points points = rand(30,3)*100; [minDist ind1 ind2] = minDistancePoints(points); minDist distancePoints(points(ind1, :), points(ind2, :)) % results should be the same
% minimal distance between 2 sets of points points1 = rand(30,2)*100; points2 = rand(30,2)*100; [minDists inds] = minDistancePoints(points1, points2); minDists(10) distancePoints(points1(10, :), points2(inds(10), :)) % results should be the same
Referenced by triangulateCurvePair().
function [ r , c ] = minDistancePoints>ind2sub_tril | ( | N, | |
idx ) |
References N.