     with FloaAK ; use FloaAK ;
     with Text_IO; use Text_IO;

     package body PlotAK is
     ----------------------------------------------------------------------
     ----------------------------------------------------------------------

     procedure Plot_XY (
       X, Y : in Vector_Type ) is
     ----------------------------------------------------------------------
       Min_X, Max_X, Min_Y, Max_Y : float;
       X_Pos : natural range 0..81;
       Y_Pos : natural range 0..24;
       Screen : array ( 1..80, 1..23 ) of integer
	 := ( others => ( others => 0 ) );
     begin
       Min_X := Min ( X );
       Max_X := Max ( X );
       Min_Y := Min ( Y );
       Max_Y := Max ( Y );
       for Index in X'range loop
	 X_Pos := natural ( 80.0 *
	   ( X ( Index ) - Min_X ) / ( Max_X - Min_X ) );
	 if X_Pos = 0 then
	   X_Pos := 1;
	 end if;
	 Y_Pos := natural ( 23.0 *
	   ( Y ( Index ) - Min_Y ) / ( Max_Y - Min_Y ) );
	 if Y_Pos = 0 then
	   Y_Pos := 1;
	 end if;
	 Screen ( X_Pos, Y_Pos ) := Screen ( X_Pos, Y_Pos ) + 1;
--       if Screen ( X_Pos, Y_Pos ) > 9 then
--         Screen := Screen - 1;
--       end if;
       end loop;
       New_Line;
       for Y_Pos in 1..23 loop
	 for X_Pos in 1..80 loop
	   if Screen ( X_Pos, Y_Pos ) > 0 then
	     Put ( '*' );
	   else
	     Put ( ' ' );
	   end if;
	 end loop;
       end loop;
       Put (   "Min_X = " ); Put ( Min_X, Aft => 2 );
       Put ( "  Max_X = " ); Put ( Max_X, Aft => 2 );
       Put ( "  Min_Y = " ); Put ( Min_Y, Aft => 2 );
       Put ( "  Max_Y = " ); Put ( Max_Y, Aft => 2 );
       New_Line;
     end Plot_XY;

     ----------------------------------------------------------------------
     ----------------------------------------------------------------------
     end PlotAK;
