Experimental preparation and measurement of quantum states of motion of a trapped atom