You say "no space restrictions", which does not require restrictions on the pre-processing time.
Consider the sorted abscissas of sites after rotation at an arbitrary angle: the site closest to the vertical line is found by dichotomy after comparisons of Lg(N) .
Now consider a continuous set of turns: you can split it into angular ranges so that the order of the sorted abscissas does not change.
So, you will find all the limiting angles, taking sites in pairs, and save the value of the angle, as well as the corresponding ordering of the rotated abscissas.
For the query, find the interval of anchor angles by first binary search (among the angles O (N²)), then the nearest site by searching for rotated abscissas (binary search among abscissas O (N)).
Done right, this will require storage of O (N³).
Given that the ordering permutations for two consecutive angles simply differ in one exchange, it is possible that O (N²) storage can be achieved using a suitable data structure.
source share