System and method for measuring the relative position of an object relating to a reference point