Which planar angles on an integer lattice are possible? As shown in this question, you can construct an angle $A$ on 3 integer points on a plane only if $\tan A$ is rational. A natural generalization is to ask which values can planar angles based on 3 points in a 3-dimensional integer lattice have? How about n-dimensional lattice?
It is easy to see that set of achievable angles in the 3D space is larger than that in 2D: $\pi/3$ angle is not possible in 2D ($\tan \pi/3 \notin \mathbb{Q}$), but is possible in 3D, it is the angle in the triangle with vertices $(1,0,0),(0,1,0),(0,0,1)$.
 A: Don't know about $3$ or $4.$
No matter what, every angle taken from a lattice (we always take the vertex at the origin) has $\cos^2 \theta$ rational, because 
$$ \cos \theta = \frac{x \cdot y}{|x| \, |y|} $$
As soon as we are in dimension $5,$ we can make anything we want of this type. It is easy to get a right angle, even in dimension $2.$ Suppose we want 
$$ \cos \theta = \frac{p}{\sqrt n} $$ with positive integers $p,n$ and  $ p < \sqrt n,$ because a cosine cannot be larger than $1.$
You need to know that every positive integer is the sum of four integer squares. Take the positive integer $n-p^2$ and write it as
$$ n-p^2 = a^2 + b^2 + c^2 + d^2.   $$
We are ready to define the two vectors in $\mathbb Z^5.$ Take
$$  x = (1,0,0,0,0), $$
$$ y = (p,a,b,c,d).  $$
Then $x \cdot y = p$ and $|x|=1$ and $|y| = \sqrt n,$ so
$$  \cos \theta = \frac{p}{1 \cdot \sqrt n}  $$
Oh, given the way I first mentioned this, square of cosine rational, we notice that
$$  \sqrt { \frac{u}{v}  } = \sqrt { \frac{u^2}{uv}  } = \frac{u}{\sqrt{uv}} $$
which is of the form $p / \sqrt n.$
A: It can be shown that that $\cos^2 \theta = \frac{p}{2^3 q}$ in 3D and $\cos^2 \theta = \frac{p}{2^4 q}$ in 4D are impossible (assuming odd $p$). This happens, because $|x|^2=2^k$ does not have primitive integer solutions for $k>1$ (3D) and $k>2$ (4D), where 'primitive' means that components of $x$ are coprime ($\gcd \{x_i\}_i=1)$. Clearly, in the lattice it is enough to only consider vectors $x$ or $y$ with coprime components.
