implement part of line+circle-based intersection logic and add tests