A sensor system and a joystick comprising the sensor system, wherein the sensor system comprises a magnetic field sensor (1), a first and a second magnetic source (2, 3). The first magnetic source is rotatable relative to a sensitive surface (10) of the sensor and generates a first magnetic field contribution (B; Bm1) of at least quadrupolar order. The second magnetic source is pivotable with respect to the sensitive surface and generates a second magnetic field contribution (Berr; Bm2). The sensor is configured for detecting at least an in-plane component of a superimposition field (Bsup) of the first and second magnetic contributions at each of a plurality of lateral measurement locations (A-H) on the sensitive surface, obtaining measurements indicative of a field gradient for at least two in-plane components (Bx, Bx-y) of the first magnetic contribution, obtaining measurements indicative of a field mean for at least two in-plane components (Berr,x, Berr,y) of the second magnetic contribution, and determining a rotation angle (α) for the first source (2) from the field gradient measurements and two angular directions (θ, (ϕ) for the second source (3) from the field mean measurements. Lateral measurement locations are arranged into at least two pairs of diametrically opposite measurement locations with respect to a center location (P) on the sensitive surface. |