function [ dfh ] = centered_finite_difference( fun, xnodes, h )
% CENTERED_FINITE_DIFFERENCE approximate the first derivative of a function
% in the nodes by using the centered finite difference scheme
%
%  [ dfh ] = centered_finite_difference( fun, xnodes, h )
%  Inputs: fun = function handle, 
%          xnodes = vector of nodes' coordinates
%          h = coordinates increment; positive and scalar value. 
%  Output: dfh = approximate values of the first derivatives of fun in the
%          nodes.
%

dfh = ( fun( xnodes + h ) - fun( xnodes - h ) ) / ( 2 * h );

return