The moment equation approach to neoclassical transport is used to calculate neoclassical particle and heat fluxes, impurity transport, the ambipolar electric field, and momentum damping rates. These equations are often written in Hamada coordinates which makes it easier to obtain analytic solutions. However, previous simplifying assumptions used to evaluate the basis vectors analytically are often invalid for advanced stellarator configurations. In this paper, a numerical method is presented by which the Hamada basis set can be determined for an arbitrary three dimensional toroidal confinement device by integrating along a magnetic field line. The method is applied to the magnetic configuration in the Helically Symmetric Experiment ͓F. S. B. Anderson, A. F. Almagri, D. T. Anderson, P. G. Matthews, J. N. Talmadge, and J. L. Shohet, Fusion Technol. 27, 273 ͑1995͔͒ and compared to the large-aspect-ratio tokamak approximation to the basis set. The results indicate that the numerical technique is a more accurate method to specify the basis vectors, especially in a device with negligible toroidal curvature.