Some embodiments provide a method of computing the estimated distance between
an external state and a set of states in a multi-state space that represents a
region of a design layout. The method identifies a polygon that encloses the set
of states. It then identifies vectors to project from the vertices of the polygon
based on a model that allows penalizes measurements in certain directions more
than other directions. Based on the projected vectors, the method then identifies
the estimated distance.