Added Polygon::Energy class to handle energy computation