function cos_out = cordiccos(theta, niters)
% CORDICSIN(theta, niters) Compute the CORDIC-based approximation to COS(theta).

% Copyright 2009-2015 The MathWorks, Inc.
%#codegen
coder.allowpcode('plain');
eml_prefer_const(theta);

if coder.target('hdl')       
    if (nargin == 1)
        cos_out = hdlcordiccos(theta);
    else
        cos_out = hdlcordiccos(theta, niters);
    end
else
    if (nargin == 1)
        [~, cos_out] = cordicsincos(theta);    
    else
        [~,cos_out] = cordicsincos(theta, niters);    
    end
end
