Sierpinski Gasket Barycentric Calculators
In a $\triangle ABC$, any point $P$ can be uniquely defined by its barycentric coordinates $(w_A, w_B, w_C)$. These coordinates represent the "weights" assigned to each vertex such that \begin{equation} P = w_A A + w_B B + w_C C \end{equation} subject to the constraint $w_A + w_B + w_C = 1$.
Each of the barycentric coordinates can be expressed in binary as $$ \begin{aligned} w_A &=(0.{a_1}{a_2}{a_3}{a_4}\text{...}){}_{\small 2} = \displaystyle \sum_{k=1}^\infty\frac{a_k}{2^k} \\ w_B &=(0.{b_1}{b_2}{b_3}{b_4}\text{...}){}_{\small 2} = \displaystyle \sum_{k=1}^\infty\frac{b_k}{2^k} \\ w_C &=(0.{c_1}{c_2}{c_3}{c_4}\text{...}){}_{\small 2} = \displaystyle \sum_{k=1}^\infty\frac{c_k}{2^k} \end{aligned} $$ (where each digit $a_k$, $b_k$, and $c_k$ is either 0 or 1). Dyadic rational numbers of the form \(k/2^n\) actually have two binary expansions, one that terminates in repeated 0's, and one that terminates in repeated 1's. For example, 3/4 is represented in binary either as \(0.11\overline{0}_{\small 2}\) or as \(0.10\overline{1}_{\small 2}\) (where the line over a digit indicates an infinite repetition.)
A point $P$ with barycentric coordinates $(w_A, w_B, w_C)$ belongs to the Sierpinski gasket $S$ if and only if there exists a binary representation for each barycentric coordinate such that $a_k + b_k + c_k = 1$ for every bit position $k \ge 1$, i.e. $$S = \left\{ (w_A,w_B,w_C) : a_k+b_k+c_k = 1 \text{ for all } k \ge 1 \right\}.$$ If a barycentric coordinate is a dyadic rational, then the point will be in \(S\) if either of the binary expansions satisfies the condition above.
For the calculators below, $\triangle ABC$ has vertices $A(1/2, \sqrt{3}/2)$, $B(0,0)$, and $C(1,0)$.
Calculator:
Euclidean → Barycentric
The Euclidean to barycentric calculator will take the two Euclidean coordinates of a point $(x,y)$ and compute the corresponding barycentric coordinates. It will also write out the beginning sequence of the binary expansion of each barycentric coordinate to compare the corresponding binary digits in each position to determine if the point is in the Sierpinski gasket. Finally, point $(x,y)$ will be plotted in the figure showing the 4th iteration of the Sierpinski gasket construction.
You can enter the $y$ coordinate as a rational, a decimal, or in the form p*sqrt(3) where $p$ is a rational number or a decimal value.
First 4 iterations. If the red dot is in a gray triangle, it is in $S_4$
but might be removed at a later iteration.
Calculator:
Barycentric → Euclidean
The barycentric to Euclidean calculator will take the barycentric coordinates of a point $(x,y)$ with respect to the vertices $A$ and $B$, compute the third barycentric coordinate with respect to vertex $C$, and then compute the corresponding Euclidean coordinates. It will also write out the beginning sequence of the binary expansion of each barycentric coordinate to compare the corresponding binary digits in each position to determine if the point is in the Sierpinski gasket. Finally, point $(x,y)$ will be plotted in the figure showing the 4th iteration of the Sierpinski gasket construction.
You can enter each barycentric coordinate as a rational number or a decimal value.
First 4 iterations. If the red dot is in a gray triangle, it is in $S_4$
but might be removed at a later iteration.
