function t = elasticityT(E,nu,ElasticityType)
% ELASTICITYCT Helper function to axisymmetric stiffness matrix.
% Also works if inputs are function handles
% Copyright 2022 The MathWorks, Inc.

if ~strcmp(ElasticityType,'as')
    t = 0;
    return
end
if ~isa(E,'function_handle')  % Convert numeric E to function handle
    E = @(l,s) E*ones(1,length(l.x));
end

if ~isa(nu,'function_handle') % Convert numeric nu to function handle
    nu = @(l,s) nu*ones(1,length(l.x));
end
lamda = @(l,s) E(l,s).*nu(l,s)./((1+nu(l,s)).*(1-2*nu(l,s)));
t =  @(l,s) 2*pi*l.x.*[lamda(l,s)./l.x; zeros(size(l.x));lamda(l,s)./l.x;zeros(size(l.x))];
end