How can I access the coordinates of a selection on a mesh?

The FAQ article How can I access the coordinates of a selection on a mesh? explains how you can get the vertices, normals and triangles of parts of a mesh which have been selected interactively.