function [az,elev,r] = cart2sph(x,y,z)
%MATLAB Code Generation Library Function

%   Copyright 2002-2021 The MathWorks, Inc.
%#codegen

eml_invariant(nargin > 2, ...
    'MATLAB:minrhs');
% This pragma makes calls in cart2sph inherit any implicit expansion
% behavior requested at a call to cart2sph.
coder.internal.implicitExpansionBuiltin;
hypotxy = hypot(x,y);
r = hypot(hypotxy,z);
elev = atan2(z,hypotxy);
az = atan2(y,x);
