Thin-film Josephson-junction quantum-interference devices require only a small amount of magnetic flux to switch them between the voltage state and the superconducting state. They are sensitive to any spurious magnetic flux present at the device. The magnetic flux may be trapped in the superconducting ground plane, particularly in ground plane holes. This paper analyzes the effects of the trapped magnetic flux on the threshold curves of three-junction Josephson interferometers. The threshold curves of the interferometer are calculated automatically by using a circuit optimization program. The automatic procedure of calculating the threshold curves of an interferometer can be applied to any Josephson-junction interferometer device. The threshold curves of both symmetric and asymmetric interferometers are calculated. We find that the threshold curves of a symmetric three-junction interferometer changes periodically as a function of the effective coupled trapped magnetic flux with a period of Φ0. The threshold curves are shifted and severely distorted in shape by the presence of the coupled trapped magnetic flux. The degeneracy of the threshold curves of a symmetric interferometer makes the unique quantitative determination of the trapped magnetic flux difficult. However, the degeneracy is removed in an asymmetric interferometer. The presence of the unbalanced trapped magnetic flux greatly shifts the entire threshold curve of an asymmetric interferometer.