get_cost_distance function

Derive cost distance function from masked slope