Artificial intelligent assistant

Alignment of rotated hexagonal grid # Square grids Given a finite square grid, I can rotate it and for any angle expressible as a Pythagorean triple that fits in to the grid, points on the rotated grid will align to the original. For an infinite grid, I believe any angle `atan(a/b)` can be obtained where a and b are integers. This would imply that given integers `(a,b)`, there exists a Pythagorean triple `(r.a)^2 + (r.b)^2 = c^2` where c is an integer, and r is rational? # Hexagonal grid **Q)** Does this also occur on a hexagonal grid, or are the only alignments of a hexagonal grid those from rotational symmetry, at multiples of `π/3`?

## Square grid

There are some additional angles that do not come from a Pythagorean triple and yet map some grid points to grid points. For example, $5^2+5^2=7^2+1^2$, hence a suitable rotation maps $(5,5)\mapsto (7,1)$ even thow $50$ is not a perfect square. (The tangent of the rotation angle in this exampleis $\frac{5\cdot 7-1\cdot 5}{5\cdot 7+1\cdot 5}=\frac 34$)

More generally, let $A=\Bbb Z[i]$. Then for any $a,b\in A$ with $|a|=|b|>0$, a multiplication by $z:=\frac ab$ (i.e., a rotation by $\arctan\frac{\operatorname{Im}(z)}{\operatorname{Re}(z)}$) will map some grid points to grid points.

## Hexagonal grid

Let $A=\Bbb Z[\omega]$, where $\omega=\frac{1+i\sqrt 3}2$. Then for any $a,b\in A$ with $|a|=|b|>0$, a multiplication by $z:=\frac ab$ will map some grid points to grid points.

Now, if $a=r+s\omega$ with $r,s\in\Bbb Z$, then $|a|^2=r^2+rs +s^2$, so these expressions take the role of the pythagorean $r^2+s^2$ of the square grid case

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy ab6a5103042b80494fc17c791d32549b