Electronic states of 2-methylenecyclopentane-1,3-diyl and trimethylenemethane