function [ i, j ] = ij_from_k ( k, nx )

%*****************************************************************************80
%
%% ij_from_k returns the (i,j) coordinates given the k coordinate.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    16 July 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer k: the k coordinate.
%
%    integer nx: the number of nodes in a row of the grid.
%
%  Output:
%
%    integer i, j: the (i,j) coordinates.
%
  i = mod ( k, nx );
  j = floor ( k / nx ) + 1;
  return
end
