summaryrefslogtreecommitdiffstats
path: root/index.md
diff options
context:
space:
mode:
Diffstat (limited to 'index.md')
-rwxr-xr-xindex.md173
1 files changed, 173 insertions, 0 deletions
diff --git a/index.md b/index.md
index 7d4bf40..b5ae08f 100755
--- a/index.md
+++ b/index.md
@@ -2,6 +2,179 @@
pagetitle: yummers
lang: en
---
+# how do you evenly tile a column?
+12 Jul 2026
+
+While walking through town the other day, I saw a pillar that looks a bit like this:
+
+![A circular pillar with vertical tiles.](./images/2026_07_12/Screenshot from 2026-07-12 17-53-00.png)
+
+In other words, it was a circular vertical column decorated with straight
+tiles. I got to thinking: how do you make such a column? I would probably
+make a cylindrical base, then stick the tiles to it. But how would I know
+how big each tile should be so that they exactly divide the circumference
+of the pillar?
+
+The problem is that, since the column is circular, and the tiles are
+straight, you can't just divide the circumference of the pillar by the
+number of tiles. Each tile creates a tiny gap vs. the cylindrical pillar,
+and those gaps would add up over the circumference of the pillar. Your
+tiles wouldn't exactly meet up when you get back to where you started!
+
+![Gaps introduced by straight tiles surrounding a circular column.](./images/2026_07_12/Screenshot from 2026-07-12 18-05-04.png)
+
+There should be a simple, mathematical relation between the circumference
+of the pillar, and the perimeter of the regular polygon with $n$
+vertices which circumscribes it.
+
+Let's draw a couple pictures. To keep things easy to visualize, we'll look
+at a case where $n = 3$, but we'll keep our math generalizable to any $n$.
+
+![Figure 1: A circle with radius $r$ circumscribed by a regular triangle with edge
+length $e$.](./images/2026_07_12/Screenshot from 2026-07-12 18-21-54.png)
+
+Our circle has radius $r$, and the circumscribing polygon has edge length $e$.
+
+Our task is to come up with some relationship between $r$ and $e$. (Or more
+precisely, an expression for $\frac{n e}{2 \pi r}$ solely in terms of $n$.)
+
+Zooming in on the bottom-right corner of our circle, we can define a few more
+interesting quantities:
+
+![Figure 2: The bottom-right third of our circle with labeled quantities.](./images/2026_07_12/Screenshot from 2026-07-12 18-41-43.png)
+
+We define:
+
+- $\sigma$: the angle between two neighboring points where the circle and
+ polygon intersect.
+- $h$: the height of the intersection point over the horizontal base of the
+ polygon.
+- $\theta$: the interior angle of the polygon.
+
+Finally, if we focus on the region outlined by $r$, $h$ and the bottom of
+the polygon:
+
+![Figure 3: The aforementioned region.](./images/2026_07_12/Screenshot from 2026-07-12 18-49-59.png)
+
+We define one final quantity, $\phi$, the interior angle of the right
+triangle formed by $h-r$ and $r$.
+
+Let's start defining these quantities in terms of each other - preferably
+exclusively in terms of $n$ where possible.
+
+$$
+\begin{align*}
+\theta &= \frac{\pi (n-2)}{n} && \text{Interior angle of a regular polygon.}\\
+\sigma &= \frac{2 \pi}{n} && \text{Central angle.} \\
+\phi &= \sigma - \frac{\pi}{2} && \text{Follows from figure 3.} \\
+\sin{\theta} &= \frac{2h}{e} && \text{Figure 3, definition of sine.} \\
+h &= \frac{e}{2} \sin{\theta} && \text{Rearrange previous equation.} \\
+\sin{\phi} &= \frac{h -r}{r} && \text{Figure 3, definition of sine.} \\
+\sin{\phi} &= \frac{h}{r} - 1 && \text{Simplify previous equation.} \\
+h &= r(\sin{\phi} + 1) && \text{Rearrange previous equation.} \\
+\frac{e}{2} \sin{\theta} &= r(\sin{\phi} + 1) && \text{Set } h \text{ equations equal
+to each other.} \\
+\frac{e}{r} &= 2 \frac{\sin{\phi} + 1}{\sin{\theta}} && \text{Rearrange terms.}
+\end{align*}
+$$
+
+We have come up with an expression relating $e$ and $r$ but it's far from the
+elegant solution we were searching for. Here is where I chucked it into
+wolframalpha and got a nice solution, then asked a clanker to derive it for me.
+The simplification process is:
+
+$$
+\begin{align*}
+\frac{e}{r} &= 2 \frac{\sin{\frac{2 \pi}{n} - \frac{\pi}{2}} + 1}{\frac{\pi (n-2)}{n}} && \text{Plug in definitions of } \phi \text{ and } \theta \text{.} \\
+ &= 2 \frac{1 - \cos{\frac{2\pi}{n}}}{\dots} && \text{In general, } \sin{x-\frac{\pi}{2}} = -\cos{x} \\
+ &= 2 \frac{2 \sin^2{\frac{\pi}{n}}}{\dots} && \text{Double angle formula.} \\
+ &= 2 \frac{\dots}{\sin{\pi - \frac{2 \pi}{n}}} && \text{Simplify.} \\
+ &= 2 \frac{\dots}{\sin{\frac{2\pi}{n}}} && \text{In general, } \sin{\pi-x} = \sin{x} \\
+ &= 2 \frac{\dots}{2 \sin{\frac{\pi}{n}} \cos{\frac{\pi}{n}}} && \text{Double angle formula.} \\
+ &= 2 \frac{2 \sin^2{\frac{\pi}{n}}}{2 \sin{\frac{\pi}{n}} \cos{\frac{\pi}{n}}} && \text{Write explicitly.} \\
+ &= 2 \frac{\sin{\frac{\pi}{n}}}{\cos{\frac{\pi}{n}}} && \text{Cancel terms.} \\
+ &= 2 \tan{\frac{\pi}{n}} && \text{Definition of tangent.}
+\end{align*}
+$$
+
+We're in the final stretch!
+
+Let $P = e \cdot n$, $C = 2 \pi r$. Then:
+
+$$
+\begin{align*}
+\frac{P}{C} &= \frac{e \cdot n}{2 \pi r} && \text{Plug in definitions.} \\
+ &= \frac{n}{2 \pi} \frac{e}{r} && \text{Group terms.} \\
+ &= \frac{n}{2 \pi} 2 \tan{\frac{\pi}{n}} && \text{Plug in equation from before.} \\
+ &= \frac{n}{\pi} \tan{\frac{\pi}{n}} && \text{Simplify.} \quad \square
+\end{align*}
+$$
+
+Here is what this equation looks like:
+
+![Plot of $P/C$.](./images/2026_07_12/Screenshot from 2026-07-12 19-26-49.png)
+
+As expected, the error starts out very large with few tiles, then quickly drops
+towards 0 (the ratio converging to 1).
+
+Our column-builders are more interested in the error with respect to the length of a tile.
+To illustrate the point: $P/C-1$ tends towards 0, but so does the length of our
+tiles. Which one converges faster, and by how much?
+
+To get the error per tile, we use the formula $(P/C - 1) \cdot n$.
+(Intuitively: each tile is small, so the amount of error it sees is inversely
+proportional to its size $\frac{1}{n}$).
+
+![Plot of $(P/C -1) \cdot n$.](./images/2026_07_12/Screenshot from 2026-07-12 19-45-20.png)
+
+Here are the values of $P/C$ and $(P/C-1) \cdot n$ for up to 30 tiles:
+
+|# of tiles | P/C | (P/C-1)*n |
+|------------|-----|----------|
+|3 |1.653986686 |1.961960059|
+|4 |1.273239545 |1.092958179|
+|5 |1.156328347 |0.7816417349|
+|6 |1.102657791 |0.6159467451|
+|7 |1.073029735 |0.511208143|
+|8 |1.054786175 |0.4382894013|
+|9 |1.042697915 |0.3842812313|
+|10 |1.034251515 |0.3425151527|
+|11 |1.028106371 |0.3091700813|
+|12 |1.023490523 |0.2818862802|
+|13 |1.019932427 |0.2591215493|
+|14 |1.017130161 |0.2398222536|
+|15 |1.014882824 |0.2232423644|
+|16 |1.013052368 |0.2088378934|
+|17 |1.011541311 |0.1962022837|
+|18 |1.010279181 |0.185025256|
+|19 |1.009213984 |0.1750656961|
+|20 |1.008306663 |0.1661332692|
+|21 |1.007527411 |0.1580756349|
+|22 |1.006853153 |0.1507693603|
+|23 |1.006265797 |0.1441133352|
+|24 |1.005750997 |0.1380239172|
+|25 |1.005297252 |0.1324312968|
+|26 |1.004895259 |0.1272767379|
+|27 |1.004537424 |0.1225104564|
+|28 |1.004217499 |0.1180899697|
+|29 |1.003930303 |0.1139788006|
+|30 |1.003671515 |0.1101454484|
+
+As we can see, the ratio of $P/C$ quickly drops below 1% (taking only 19 tiles)
+but even with 30 tiles the per-tile error still doesn't drops below 10%.
+Therefore in real-world conditions, you actually need to account for this
+source of error, or live with a narrower-than-intended tile on your column.
+
+Finally, let's address our problem statement directly. I have a column of
+radius $r$, and I want to wrap it with $n$ tiles. What should the edge length
+$e$ of each tile be so that the tiles wrap the column exactly?
+
+Rearranging an equation given above:
+
+$$
+e = 2r \tan{\frac{\pi}{n}}
+$$
+
# histogram-preserving tri-planar projection
31 March 2026