TITLE: Is it possible to change position of the segment so that it is parallel to Y axis?
QUESTION [8 upvotes]: Let's consider infinite Cartesian system of coordinates. Assume that in any lattice point (i.e. both coordinates are integers) there is a spike. I have a line segment of length $n$ (it is an integer). It is parallel to X axis, as shown below (image shows only a part of system of coordinates).

I want to make it parallel to Y axis as shown below.

What I can do is rotate and move this line segment, but without raising it up. I can't change shape, length etc. of it. Movement and rotation, as you can see, is limited by the spikes in lattice points. Below is an example of one of possible moves. My question: is it possible to make this line segment parallel to Y-axis?

I do believe that Chinese Remainder Theorem has something to do with this.

REPLY [3 votes]: Put an edge of the stick in the point $O=(\sqrt 2,1/2)$. Consider all points with integer coordinates which have distance from $0$ not larger than $n+1$ ($n$ is the length of the stick). These are a finite number of points. Order them by their angle with respect to $O$: $\alpha_1, \dots, \alpha_N$. Since $O$ has an irrational coordinate, all points have a different angle (not really important) and moreover if there is a point with angle $\alpha$ there is no point with angle $\alpha+\pi$ (this is used to simplify the algorithm). To make the stick rotate around the point $O$ it is enough to describe a "move" to pass across each pin. Let $\alpha$ be the angle of the pin $P$. Since the circle of radius $n+1$ centered in $O$ contains a finite number of pins, there is a small angle around $\alpha$ and around $\alpha+\pi$ which contains no pins apart from $P$. Also a small circle around $O$ contains no pins (not really needed). The pin can then move in the orange region of the picture. You can easily translate it in the opposite sector, rotate a little and translate back to pass the point $P$.
A very similar problem: http://mathworld.wolfram.com/KakeyaNeedleProblem.html