1. A system for measuring a pattern on a sample, comprising: a data processing system that processes a set of two-dimensional distribution data of intensities from the sample, to calculate: a set of edge points indicative of position of edges of said pattern in a two-dimensional plane from said two-dimensional distribution data; an approximation edge indicative of the edge of the pattern; an edge roughness data by calculating a difference between the set of edge points and said approximation edge; and a correlation between a first portion of the edge roughness data and a second portion of the edge roughness data.