eaf function

Exact computation of the EAF in 2D or 3D