added quadratic error function implementation used by dual contouring