function gam_slope = cg_gam_slope(reset_value_for_gam)
% function returns the value of terrain slope, gam_slope.
% gam_slope is a persistent variable that can be "reset" by
% calling the function with an input argument "reset_value_for_gam".
% Katie Byl, 1/19/2010. ECE594D, Winter 2010. (UCSB)

persistent gam_slope_saved

if isempty(gam_slope_saved)
    gam_slope_saved = 3*pi/180;
end
if  exist('reset_value_for_gam') && ~isempty(reset_value_for_gam)
    gam_slope_saved = reset_value_for_gam;
end

gam_slope = gam_slope_saved;
