For use with the Directionality routine above. Given an atom (atom) and a direction (dir) return the absolute value of the cosine of the angle between the the line running through atom in direction dir and the line between atom and test_atom
The idea is that this will be called with the origin atom from Directionality as atom, the eigenvector associated with the smallest eigenvalue as dir and a potentially new atom to connect to atom with a spline as test_atom.
If the result is close to 1 then accept the test_atom, and reject if close to zero