calc_ref function

Reference points