function [ point_coord, face_order, face_point ] = dodec_shape_3d ( ...
  point_num, face_num, face_order_max )

%*****************************************************************************80
%
%% DODEC_SHAPE_3D describes a dodecahedron in 3D.
%
%  Discussion:
%
%    The vertices lie on the unit sphere.
%
%    The dual of the dodecahedron is the icosahedron.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    02 February 2005
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer POINT_NUM, the number of points in the shape.
%
%    Input, integer FACE_NUM, the number of faces in the shape.
%
%    Input, integer FACE_ORDER_MAX, the maximum number of vertices per face.
%
%    Output, real POINT_COORD(3,POINT_NUM), the vertices.
%
%    Output, integer FACE_ORDER[FACE_NUM], the number of vertices per face.
%
%    Output, integer FACE_POINT(FACE_ORDER_MAX,POINT_NUM); FACE_POINT(I,J)
%    contains the index of the I-th point in the J-th face.  The
%    points are listed in the counter-clockwise direction defined
%    by the outward normal at the face.
%
  dim_num = 3;
%
%  Set point coordinates.
%
  phi = 0.5 * ( sqrt ( 5.0 ) + 1.0 );

  a = 1.0 / sqrt ( 3.0 );
  b = phi / sqrt ( 3.0 );
  c = ( phi - 1.0 ) / sqrt ( 3.0 );
  z = 0.0;

  point_coord(1:dim_num,1:point_num) = [ ...
      a,  a,  a; ...
      a,  a, -a; ...
      a, -a,  a; ...
      a, -a, -a; ...
     -a,  a,  a; ...
     -a,  a, -a; ...
     -a, -a,  a; ...
     -a, -a, -a; ...
      c,  b,  z; ...
     -c,  b,  z; ...
      c, -b,  z; ...
     -c, -b,  z; ...
      b,  z,  c; ...
      b,  z, -c; ...
     -b,  z,  c; ...
     -b,  z, -c; ...
      z,  c,  b; ...
      z, -c,  b; ...
      z,  c, -b; ...
      z, -c, -b ]';
%
%  Set the face orders.
%
  face_order(1:face_num) = [ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 ]';
%
%  Set the faces.
%
  face_point(1:face_order_max,1:face_num) = [ ...
      2,  9,  1, 13, 14; ...
      5, 10,  6, 16, 15; ...
      3, 11,  4, 14, 13; ...
      8, 12,  7, 15, 16; ...
      3, 13,  1, 17, 18; ...
      2, 14,  4, 20, 19; ...
      5, 15,  7, 18, 17; ...
      8, 16,  6, 19, 20; ...
      5, 17,  1,  9, 10; ...
      3, 18,  7, 12, 11; ...
      2, 19,  6, 10,  9; ...
      8, 20,  4, 11, 12 ]';

  return
end
