Topological configurations of the magnetic field play key roles in the evolution of space plasmas. This paper presents a novel algorithm that can estimate the quadratic magnetic gradient as well as the complete geometrical features of magnetic field lines, based on magnetic field and current density measurements by a multiple spacecraft constellation at 4 or more points. The explicit estimators for the linear and quadratic gradients, the apparent velocity of the magnetic structure and the curvature and torsion of the magnetic field lines can be obtained with well predicted accuracies. The feasibility and accuracy of the method have been verified with thorough tests. The algorithm has been successfully applied to exhibit the geometrical structure of a flux rope. This algorithm has wide applications for uncovering a variety of magnetic configurations in space plasmas.