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

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

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