function z = sag(r,c) %SAG The sag function (for spherical surfaces). % Z = SAG(R,C) % % C is the curvature (1/radius_of_curvature) % R is the radius at which sag is to be evaluated z = c*(r.^2)./(1+sqrt(1-(c*r).^2));
function z = sag(r,c) %SAG The sag function (for spherical surfaces). % Z = SAG(R,C) % % C is the curvature (1/radius_of_curvature) % R is the radius at which sag is to be evaluated z = c*(r.^2)./(1+sqrt(1-(c*r).^2));