The shape of a mechanically equilibrated dislocation line is of considerabl
e interest in the study of plastic deformation of metals and alloys. A gene
ral numerical method for finding such configurations in arbitrary stress fi
elds has been developed. Analogous to the finite-element method (FEM), a ge
neral dislocation line is approximated by a series of straight segments (el
ements) bounded by nodes. The equilibrium configuration is found by minimiz
ing the system energy with respect to nodal positions using a Newton-Raphso
n procedure. This approach, termed the finite-segment method (FSM), confers
several advantages relative to segment-based, explicit formulations. The u
tility, generality, and robustness of the FSM is demonstrated by analyzing
the Orowan bypass mechanism and a model of dislocation generation and equil
ibration at misfitting particles. Energy differences from previous analytic
al methods based on simple loop shapes are significant, up to XO pet. Expli
cit expressions for the coordinate transformations, energies, and forces re
quired for numerical implementation are presented.