Arranging some magnets can intensify its magnetic field, as known as Halbach array. Magnets can be considered as a 3 dimensional array of magnetic dipoles. Optimizing these magnetic dipole directions, magnets can be more stronger. This article shows how to ditermine these directions, and how to magnetize ferromagnetic material with that directions.