function circle_map_letters ( a )

%*****************************************************************************80
%
%% CIRCLE_MAP_LETTERS plots the image of the unit circle under the 2x2 matrix A.
%
%  Discussion:
%
%    A typical 2x2 matrix will map the unit circle to some kind of tilted 
%    ellipse.  The aspect ratio of the ellipse (ratio of major to minor axes) 
%    is a measure of the conditioning of the matrix.
%
%    A singular matrix maps the unit circle to a line.
%
%    A diagonal matrix maps the unit circle to an ellipse with no tilting.
%    (There is no rotation.)
%
%    An orthogonal matrix maps the unit circle to the unit circle (but points
%    may have rotated.)
%
%    The identity matrix maps the unit circle to itself.
%
%    The singular value decomposition can predict the shape of the mapping:
%
%    * The vector V(1,1:2) maps to S(1)*U(1:2,1),
%    * The vector V(2,1:2) maps to S(2)*U(1:2,2).
%
%    The ellipse has an aspect ratio of S(1)/S(2).
%
%    The "tilt" or slope of the ellipse is U(2,1)/U(1,1).
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    16 December 2018
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, real A(2,2), the matrix whose mapping of the unit circle 
%    is to be studied.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'CIRCLE_MAP_LETTERS\n' );
  fprintf ( 1, '  Given a matrix A,\n' );
  fprintf ( 1, '  plot points x on the unit circle, and\n' );
  fprintf ( 1, '  the images A*x of those points.\n' );

  if ( nargin < 1 )
    a = [ 4.0, 1.0; ...
          1.0, 2.0 ];
    fprintf ( 1, '\n' );
    fprintf ( 1, '  Matrix A not supplied, using default.\n' );
  end

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Matrix A:\n' );
  fprintf ( 1, '\n' );
  disp ( a );

  n = 20;

  i = [ 0 : n - 1 ];

  angle = 2 * pi * i / n;

  r = 1.0;

  x = [ r*cos(angle); r*sin(angle) ];
%
%  AX contains the image of each point under the mapping X -> A*X.
%
  ax =  a * x;

  figure ( 1 )
  clf
  hold on
%
%  Plot the corners of the region.  This is a trick to force MATLAB
%  to plot in a square with equal axes.  
%
  p_min = min ( min ( min ( ax ) ), min ( min ( x ) ) );
  p_max = max ( max ( max ( ax ) ), max ( max ( x ) ) );
  area = [];
  scatter ( [ p_min, p_max, p_max, p_min ], [ p_min, p_min, p_max, p_max ], area, 'k' );
%
%  Plot points on the unit circle.
%
  i = 97;
  for j = 1 : n
    text ( x(1,j), x(2,j), char(i), 'Color', 'b' )
    i = i + 1;
    if ( 122 < i )
      i = 97;
    end
  end
%
%  Plot the images AX of points X on the unit circle.
%
  i = 65;
  for j = 1 : n
    text ( ax(1,j), ax(2,j), char(i), 'color', 'r' )
    i = i + 1;
    if ( 90 < i )
      i = 65;
    end
  end

  xlabel ( '--X axis--' )
  ylabel ( '--Y axis--' )
  axis ( [ p_min, p_max, p_min, p_max ] );
  axis equal
  axis tight
  axis square
  grid ( 'on' )

  hold off
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'CIRCLE_MAP_LETTERS:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end
