A displacement device with a first part and a second part which are displaceable relative to one another in at least an X-direction and a Y-direction perpendicular thereto, wherein said first part has a carrier which extends substantially parallel to said X-direction and said Y-direction and on which a system of magnets is fastened in a pattern of rows extending parallel to said X-direction and columns extending parallel to said Y-direction, wherein an equal distance is present each time between the rows and between the columns, wherein in each said row and in each said column magnets of a first kind (N) with a magnetization direction perpendicular to said carrier and directed to said second part and magnets of a second kind (Z) with a magnetization direction perpendicular to said carrier and directed away from said second part are positioned in alteration, and wherein a magnet of a third kind (H) with a magnetization direction directed from a magnet of said second kind (Z) to a magnet of said first kind (N) is arranged between the magnets of said first kind (N) and said second kind (Z), while said second part is provided with a system of electric coils with at least one electric coil of a first kind (C1), with current conductors situated in a magnetic field of said system of magnets and enclosing an angle of substantially 45° with said X-direction, and with at least one electric coil of a second kind (C2), also with current conductors situated in said magnetic field of said system of magnets and enclosing an angle of substantially 45° with said X-direction but directed perpendicular to said current conductors of said first electric coil (C1), wherein said displacement device is provided with a number of sensors sensitive to magnetic fields, which sensors supply a signal which is dependent on the local mutual positions of said magnets of said first part relative to said electric coils of said second part in a region where these two parts overlap, said sensors sensitive to magnetic fields being Hall sensors which are situated at regular distances to one another, and wherein said magnets of said first kind (N) and said second kind (Z) are of an identical square shape with equal sides, and said magnets of said third kind (H) have an oblong shape with longer sides and shorter sides, said longer sides being equally long as said equal sides of said magnets of said first kind (N) and said second kind (Z), while the ratio of the length of said shorter side of said magnet of said third kind (H) to the length of said longer side thereof lies between 0.25 and 0.59.