A geometric deletion-restriction formula