function [ a, b, c ] = triangle_sides ( v )

%*****************************************************************************80
%
%% triangle_sides() computes the side lengths of a triangle.
%
%  Discussion:
%
%    The side lengths are calculated, and ordered so that a <= b <= c.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    01 March 2019
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real V(3,2), the vertices of the triangle.
%
%  Output:
%
%    real A, B, C, the triangle side lengths.
%    with A <= B <= C.
%

%
%  Compute the lengths.
%
  t(1) = norm ( v(1,:) - v(2,:) );
  t(2) = norm ( v(2,:) - v(3,:) );
  t(3) = norm ( v(3,:) - v(1,:) );
%
%  Sort them.
%
  [ t, index ] = sort ( t );
%
%  A <= B <= C.
%
  a = t(1);
  b = t(2);
  c = t(3);

  return
end
