Optimizing the separation factor along a directional well trajectory to minimize collision risk