solve for line intersection