The measured response matrix giving the change in orbit at beam position monitors (BPMs) with changes in steering magnet excitation can be used to accurately calibrate the linear optics in an electron storage ring [1-8]. A computer code called LOCO (Linear Optics from Closed Orbits) was developed to analyze the NSLS X-Ray Ring measured response matrix to determine: the gradients in all 56 quadrupole magnets; the calibration of the steering magnets and BPMs; the roll of the quadrupoles, steering magnets, and BPMs about the electron beam direction; the longitudinal magnetic centers of the orbit steering magnets; the horizontal dispersion at the orbit steering magnets; and the transverse mis-alignment of the electron orbit in each of the sextupoles. Random orbit measurement error from the BPMs propagated to give only 0.04% rms error in the determination of individual quadrupole gradients and 0.4 mrad rms error in the determination of individual quadrupole rolls. Small variations of a few parts in a thousand in the quadrupole gradients within an individual family were resolved. The optics derived by LOCO gave accurate predictions of the horizontal dispersion, the beta functions, and the horizontal and vertical emittances, and it gave good qualitative agreement with the measured vertical dispersion. The improved understanding of the X-Ray Ring has enabled us to increase the synchrotron radiation brightness. The LOCO code can also be used to find the quadrupole family gradients that best correct for gradient errors in quadrupoles, in sextupoles, and from synchrotron radiation insertion devices. In this way the design periodicity of a storage ring's optics can be restored. An example of periodicity restoration will be presented for the NSLS VUV Ring. LOCO has also produced useful results when applied to the ALS storage ring .