Accelerometers have been around for a while now. They measure the acceleration of the chip. As acceleration is directional they have the possibility of measuring in three axis. On earth we have the background acceleration of gravity which all accelerometers are subject to. This means that they will read 1g in the direction towards the ground. The other two directions perpendicular to this one measure zero when the accelerometer is stationary.

There are four accelerometers i have looked at using the arduino. You will find both the software and hardware required to interface them and get meaningfull accelleration data out of them. They all have different features so its horses for courses.

BMA180 3 axis 12 or 14 bit resolution with many settings including digital filters
LIS301dl 3 axis 8 bit resolution I2C 2g and 8g accelerometer
ADXL335 3 axis accelerometer 3g setting without onboard power regulation.
MMA7455  cheap 3 axis accelerometer 2g 4g and 8g settings and I2C interface.

You can use accelometers for defining orientation if the device is stationary as gravity allways points down. When the X axis reads 1g and the other two zero you know the X axis is pointing straight down.  The articles describe how you can get meaningfull data from each of them. Accelerometers have one disadvantage and that is that they produce gitter which is a random noise on top of an otherwise good signal. The software can take care of this by smoothing the signal out. Of course this has an influence on the speed of response. Some of the accelerometers have filter software onboard of the chip which can be programmed with this filter function.

accellerometer shop button