Ignore parfor_progress file
Replace random direction generation code, sin and cos are faster than the random loop
Normalize all computations with dir, to ensure length 1