A method and apparatus for determining distance