A general approach to plasma shape control and its application to the Alcator C-Mod tokamak are described. The method is linear in the magnetic measurements but is entirely algorithmic, requiring no fitting of databases. Estimators of the shape parameters are based on a complete vacuum reconstruction of the flux, so that control points can be defined anywhere within the reconstructed region. The conversion of flux differences into flux-surface distances and the calculation of appropriate coil currents for controlling each parameter require a specific reference equilibrium. However, the control is very insensitive to the choice of reference equilibrium provided that the shape parameters are chosen appropriately. Control current combinations that are orthogonal, in the sense of changing one parameter and not the others, are obtained. Experiments with these estimators and controllers show them to be accurate and robust over a wide range of plasma shapes.