The method involves measuring a vector and a local gradient of magnetic flux density of spherical permanent magnets (1) from a location of a position sensor (2) by three dimensional magnetic field sensors (3) i.e. Hall sensors. A position and orientation of a magnetic dipole of the permanent magnets are calculated relative to the position sensor from the vector and the local gradient. The spherical permanent magnets are used with homogenous magnetization. The magnetic field sensors are arranged at the position sensor in a plane in such a manner that the local gradient is measured. An independent claim is also included for an arrangement for determining position, comprising permanent magnets.