A mobile agent has to reach a target in the Euclidean plane. Both the agent and the target are modeled as points. At the beginning, the agent is at distance at most D > 0 from the target. Reaching the target means that the agent gets at a sensing distance at most r > 0 from it. The agent has a measure of length and a compass. We consider two scenarios: in the static scenario the target is inert, and in the dynamic scenario it may move arbitrarily at any (possibly varying) speed bounded by v. The agent has no information about the parameters of the problem, in particular it does not know D, r or v. The goal is to reach the target at lowest possible cost, measured by the total length of the trajectory of the agent.Our main result is establishing the minimum cost (up to multiplicative constants) of reaching the target under both scenarios, and providing the optimal algorithm for the agent. For the static scenario the minimum cost is Θ((log D + log 1 r )D 2 /r), and for the dynamic scenario it is Θ((log M + log 1 r )M 2 /r), where M = max (D, v). Under the latter scenario, the speed of the agent in our algorithm grows exponentially with time, and we prove that for an agent whose speed grows only polynomially with time, this cost is impossible to achieve.