sub function in ctFIRE, modified from calc_fiberang.m in FIRE