function v = polygon_convex_random ( n )

%*****************************************************************************80
%
%% polygon_convex_random() computes a random convex polygon with n vertices.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    25 November 2024
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer n: the number of vertices in the polygon.
%
%  Output:
%
%    real v(n,2): the vertices of the convex polygon.
%

%
%  Generate n normal random 2D points.
%
  u = zeros ( n, 2 );
  for j = 1 : 2
    for i = 1 : n
      u(i,j) = randn ( );
    end
  end
%
%  Compute the mean.
%
  c = mean ( u );
%
%  Recenter the data on the mean.
%
  u2 = u - c;
%
%  Sort the vectors (u-c) by increasing angle.
%
  u3 = vector2d_angle_sort ( u2 );
%
%  Convert the Minkowski polygon to vertex representation.
%
  v = polygon_minkowski_to_vertices ( u3 );

  return
end

