Disclosed are a system and method to accurately determine the location andorientation of a part of an elongated insertionshaft of an endoscope-like device or of an object located on or in theelongated insertion shaft when the elongated insertion shaft isinserted into a lumen or cavity of a human or animal body or into the interiorof a manufactured object such that direct visual observationof the part of the elongated insertion shaft or of the object located on or inthe elongated insertion shaft is blocked.