Magnetostatic dipolar anisotropy energy and the total dipolar anisotropy constant, , in periodic arrays of ferromagnetic nanowires have been calculated as a function of the nanowire radius, the interwall distance of the nanowires in the arrays and the geometry of the array (square or hexagonal), by using a realistic atomistic model and the Ewald method. The simulated nanowires have a radius size up to 175 Å that corresponds to 31 500 atoms, and the simulated nanowire arrays have interwall distances between 35 and 3000 Å. The dependence of total magnetostatic dipolar anisotropy constant on the nanowire radius, their interwall distance and the type of array symmetry has been analyzed. The total dipolar anisotropy constant, which is the sum of the intrananowire dipolar anisotropy constant, , due to the dipolar interactions inside an isolated nanowire and the main responsible of the shape anisotropy, and of the internanowire dipolar anisotropy constant, , due to the magnetostatic dipolar interactions among nanowires in the array, have been calculated and compared with the magnetocrystalline anisotropy constant for three nanowire compositions and their crystalline structures. The simulations of the nanowire arrays with large interwall distances have been used to calculate the intrananowire anisotropy constant, , and to analyze the competition between the intrananowire, internanowire and magnetocrystalline anisotropies. According to some magnetic theories, the ratio equals to the areal filling fraction of a nanowire array. Present calculations indicate that the equation for the areal filling fraction matches perfectly for any interwall distance and radius of Ni and Co nanowire arrays. This first equation is used to write a general equation that relates the radius and interwall distance of nanowire arrays with the intrananowire, internanowire and magnetocrystalline anisotropies. This general equation allows to design the geometry of nanowire arrays with the desired orientation of the easy magnetization axis.