how to calculate flatness - Search