We describe the configuration space S of polygons with prescribed edge slopes, and study the perimeter P as a Morse function on S. We characterize critical points of P (these are tangential polygons) and compute their Morse indices. This setup is motivated by a number of results about critical points and Morse indices of the oriented area function defined on the configuration space of polygons with prescribed edge lengths (flexible polygons). As a by-product, we present an independent computation of the Morse index of the area function (obtained earlier by G. Panina and A. Zhukova).2000 Mathematics Subject Classification. 52R70, 52B99. Key words and phrases. Morse index, critical point, cyclic polygon, flexible polygon. 1 The space L appears in the literature as "configuration space of a flexible polygon", or "configuration space of a polygonal linkage", or just as "space of polygons".