# 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)$.

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.$

• Good. In other words, ability to construct $\theta$ is defined by existence of a solution to the appropriate Diophantine equation of degree 4, e.g. $(x_1y_1+x_2y_2+x_3y_3)^2=\cos^2 \theta (x_1^2+x_2^2+x_3^2)(y_1^2+y_2^2+y_3^2)$ for dimension 3. – xivaxy Apr 30 '15 at 20:02
• @xivaxy, I guess so. Suggest you run computer experiments in two variables and in three, let all the variables go up to some modest absolute value. The known restrictions for two variables should show up (I imagine we are taking $\cos^2 \theta$ and finding the gcd of denominator and numerator so as to get the fraction in lowest terms, then output the list by increasing denominator). Should be revealing. Oh, may demand $x_1,y_1 > 0,$ but after that must allow negative.. – Will Jagy Apr 30 '15 at 22:17

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.