A pointing device for controlling movement of a cursor or any other type of object or marker on a display of an electronic device, the pointing device comprising: a first rotational sensor providing a first rotational velocity signal R X for rotational movement about a first axis (X, 105); a second rotational sensor providing a second rotational velocity signal R Z for rotational movement about a second axis (Z, 109); a first accelerometer providing a first acceleration signal A X in response to a gravitational acceleration in a first direction along the first axis; a second accelerometer providing a second acceleration signal A Z in response to a gravitational acceleration in a second direction along the second axis; a third accelerometer providing a third acceleration signal A Y in response to a gravitational acceleration in a third direction along a third axis (Y, 107); the three axes (X, Y, Z) being perpendicular to each other and defining a three-dimensional Cartesian coordinate system; R X, R Z, A X, Ay, A Z being measured in the body frame of reference of the pointing device; said pointing device further comprising a processing unit that is configured to (a) receive R X, R Z, Ax, Ay, and A Z from the respective rotational sensors and accelerometers, (b) calculate compensated cursor control signals X comp, Y comp in a user frame of reference; (c) transmit the compensated cursor movement signals to a receiver that is coupled to the electronic device; and being characterized in that the compensated cursor control signals are pitch-and-roll compensated cursor control signals and are based on an algebraic algorithm, and in that calculating pitch-and-roll-compensated cursor control signals X comp, Y comp by said processing unit comprises: (a) calculating A XZ = [A X 2 + A Z 2] 1/2 and A XYZ = [A X 2 + A Y 2 + A Z 2] 1/2; (b) calculating X comp = [[A X * R X + A Z * R Z]/ A XZ]*[A XYZ /A XZ]; and Y comp = [A X * R Z ― A Z * R X]/A XZ. a first rotational sensor providing a first rotational velocity signal R X for rotational movement about a first axis (X, 105); a second rotational sensor providing a second rotational velocity signal R Z for rotational movement about a second axis (Z, 109); a first accelerometer providing a first acceleration signal A X in response to a gravitational acceleration in a first direction along the first axis; a second accelerometer providing a second acceleration signal A Z in response to a gravitational acceleration in a second direction along the second axis; a third accelerometer providing a third acceleration signal A Y in response to a gravitational acceleration in a third direction along a third axis (Y, 107); the three axes (X, Y, Z) being perpendicular to each other and defining a three-dimensional Cartesian coordinate system; R X, R Z, A X, Ay, A Z being measured in the body frame of reference of the pointing device; said pointing device further comprising a processing unit that is configured to (a) receive R X, R Z, Ax, Ay, and A Z from the respective rotational sensors and accelerometers, (b) calculate compensated cursor control signals X comp, Y comp in a user frame of reference; (c) transmit the compensated cursor movement signals to a receiver that is coupled to the electronic device; and being characterized in that the compensated cursor control signals are pitch-and-roll compensated cursor control signals and are based on an algebraic algorithm, and in that calculating pitch-and-roll-compensated cursor control signals X comp, Y comp by said processing unit comprises: (a) calculating A XZ = [A X 2 + A Z 2] 1/2 and A XYZ = [A X 2 + A Y 2 + A Z 2] 1/2; (b) calculating X comp = [[A X * R X + A Z * R Z]/ A XZ]*[A XYZ /A XZ]; and Y comp = [A X * R Z ― A Z * R X]/A XZ. (a) calculating A XZ = [A X 2 + A Z 2] 1/2 and A XYZ = [A X 2 + A Y 2 + A Z 2] 1/2; (b) calculating X comp = [[A X * R X + A Z * R Z]/ A XZ]*[A XYZ /A XZ]; and Y comp = [A X * R Z ― A Z * R X]/A XZ.