function y = djacpoly(n,a,b,z,k)
% DJACPOLY - Calculate the derivative of Jacobi polynomial
% Y = DJACPOLY(N,A,B,Z,K)
%   Returns the Kth derivatives of the Jacobi polynomial of Nth order, 
%   (A,B)-type evaluated in the points given by the vector Z.
%
% See also: jacpoly

% Peter Rucz
% 2010-2015

% Zeroth order polynomial is constant
if n == 0 
    y = zeros(size(z));
% Otherwise
else
    y = gamma(a+b+n+1+k)/(2^k*gamma(a+b+n+1))*jacpoly(n-k,a+k,b+k,z);
end

end % of djacpoly