This manuscript discusses the difficulties with magnetic position and orientation (MPO) system design and proposes a general method for finding optimal layouts. The formalism introduces a system quality measure through state separation and reduces the question “How to design an MPO system?” to a global optimization problem. The latter is then solved by combining differential evolution algorithms with magnet shape variation based on analytical computations of the field. The proposed formalism is then applied to study possible realizations of continuous three-axis joystick motion tracking, realized with just a single magnet and a single 3D magnetic field sensor. The computations show that this is possible when a specific design condition is fulfilled and that large state separations as high as 1mT/∘ can be achieved under realistic conditions. Finally, a comparison to state-of-the-art design methods is drawn, computation accuracy is reviewed critically, and an experimental validation is presented.