function [A,P,B] = Triangle_JMS(V1,V2,V3)
% Find triangle properties
% Input:
%   V1,V2,V3 : coordinates of triangle vertices
% Output:
%   A : triangle area
%   P : triangle perimeter length
%   B : trangle baricenter

nd = numel(V1);  % space dimension of vectors
l1 = V2-V1;
l2 = V3-V2;
l3 = V1-V3;
if nd==2
  A = 0.5*abs(l1(1)*l2(2)-l1(2)*l2(1));
elseif nd==3
  A = 0.5*norm(cross(l1,l2));
else
  error('Trinagle: unexpected space dimension')
end
P = norm(l1)+norm(l2)+norm(l3);
B = (V1+V2+V3)/3;

end
