function [ conn_value ] = pairValue( point1, point2, label1, label2 )
%UNTITLED2 Summary of this function goes here
%   Detailed explanation goes here
point_x1 = point1(1,1); point_y1 = point1(1,2);
point_x2 = point2(1,1); point_y2 = point2(1,2);

label_x1 = label1(1,1); label_y1 = label1(1,2);
label_x2 = label2(1,1); label_y2 = label2(1,2);

delta_D2 = (label_x2 - label_x1) * (label_x2 - label_x1) + (label_y2 - label_y1) * (label_y2 - label_y1);
delta_D = sqrt(delta_D2);
star_D2 =  (point_x2 - point_x1) * (point_x2 - point_x1) + (point_y2 - point_y1) * (point_y2 - point_y1);
star_D  = sqrt(star_D2);

up_value = -2 * abs(delta_D - star_D);

below_value = sqrt(delta_D2 + star_D2);

conn_value = exp(up_value/below_value);
end

