Electronic absorption spectrum of nitrate ion and boron trihalides