Monday, September 22, 2025

A nice analogy in Spherical Geometry with a nicer application to Ceva

It is well known that the Law of sines has a spherical counterpart. But from the Wiki article, we can infer something even better. That is,

$\displaystyle V=\frac{1}{6}\sin{a}\sin{b}\sin{C}=\frac{1}{6}\sin{b}\sin{c}\sin{A}=\frac{1}{6}\sin{c}\sin{a}\sin{B}$

where $V$ is the volume of tetrahedron formed by the vertices of the spherical triangle along with the origin. The above can be re-written as

$\displaystyle V=\frac{1}{6}\sin{a}\sin{h_a}=\frac{1}{6}\sin{b}\sin{h_b}=\frac{1}{6}\sin{c}\sin{h_c}$

where $h_a$ is the altitude passing through $A$ and so on. This way, we can see the volume described above plays a role very similar to that of area in plane geometry. From this, we note that for two spherical triangles with the same height,

$V_1/V_2=\sin{b_1}/\sin{b_2}$

This fact can be used to prove Ceva's theorem, a powerful theorem in plane geometry. Though it is well known that Ceva's theorem also works for spherical geometry, I was not able to find a clear proof which we address in post.

Note that even though the volume and sine-of-side gives a nice analogy with the planar case, we lose the ability to add or subtract the sides and area which is very useful in the planar case. However, this does not seem to be a serious limitation.

While the proof given in Wiki article uses 'subtracting two areas', we can achieve the result even without that. Using the notations used in the Wiki article (but assuming a spherical triangle) and denoting the volume of a tetrahedron formed by points $X$, $Y$, $Z$ and the origin by $|XYZ|$,

$\displaystyle \frac{\sin OC}{\sin OF}=\frac{|OCB|}{|OBF|}$ and $\displaystyle \frac{\sin FB}{\sin AB}=\frac{|OFB|}{|OAB|}$

Combining the two, we have $\displaystyle \frac{\sin OC}{\sin OF}=\frac{|OBC|}{|OAB|}\frac{\sin AB}{\sin FB}$

We can use a similar argument to show $\displaystyle \frac{\sin OC}{\sin OF}=\frac{|OCA|}{|OAB|}\frac{\sin AB}{\sin AF}$

Using the above two, we have $\displaystyle \frac{|OBC|}{|OCA|}=\frac{\sin FB}{\sin AF}$

We can replicate this to the other sides as well. Then,

$\displaystyle \frac{\sin AF}{\sin FB} \cdot \frac{\sin BD}{\sin DC} \cdot \frac{\sin CE}{\sin EA}=\frac{|OCA|}{|OBC|} \cdot \frac{|OAB|}{|OCA|}\cdot \frac{|OBC|}{|OAB|}=1$

The existence of Ceva's theorem can then be used to show the concurrency of medians, altitudes and angle bisectors of spherical triangles (strictly speaking, we need the converse of Ceva's, but at this point I'm taking it for granted).

Hope you enjoyed this post.

Yours Aye
Me 

Saturday, September 13, 2025

Sol LeWitt and his Incomplete Cubes

 The recent video on 3Blue1Brown is something I enjoyed after a long time in the channel. While any post, article or video about Burnside's Lemma is always a delight, the introduction of Sol Lewitt and his mathematical art made the video all the more satisfying to me.

Naturally, I too wanted to explore this idea. I was interested in couple of things - what if we include reflections as well? what about cubes that are unconnected?

While I tried to find the answers mathematically, I realized that I'm both stupid and lazy to figure these myself. I decided to take the easy way and use Mathematica to aid myself, and these results form the crux of this post.

While I understand that from an artist's perpective, Sol might have been interested about (only) connected cubes, we don't have to constrain ourselves with that. With a straightforward bruteforce approach, Mathematica gave me the following.

Count of Sol LeWitt's cubes by Connected Components and Number of Edges

Rows in the above matrix gives the number of connected components and the Columns represents the number of edges. For example, the top left value shows that there is exactly one cube that has $0$ connected components and $0$ edges - (obviously) the empty cube. Similarly, we can see that $23$ cubes have $6$ edges and $2$ connected components.

Some examples of Sol LeWitt's Incomplete cubes

The second row of the matrix (representing the number of cubes with exactly one connected component) was what Sol was interested. We see the two sums to $127$ of which $4$ are planar and $1$ is the complete cube giving the $122$ cubes that Sol found.

From here, I realized that the code I wrote should be easily extendable to identify reflections as well. With the assumption that the Octahedral group (3D equivalent to Dihedral group) is a combination of rotation and point reflection, I modified the same and got the following 'count' matrix.

Count of Sol LeWitt's cubes by Connected Components and Number of Edges with reflections identified

We see that there are a total of $144$ unique cubes after identifying rotations and reflections. Summing the second row, we see that there are $82$ cubes that have exactly one connected component of which we know $4$ are planar and one is the complete cube.

All $82$ connected cubes identifying reflections and rotations

First Version of Mathematica code
Clear["Global`*"];
vertexcoordinates = {1 -> {-1, -1, -1}, 2 -> {1, -1, -1}, 3 -> {1, 1, -1}, 4 -> {-1, 1, -1},
    5 -> {-1, -1, 1}, 6 -> {1, -1, 1}, 7 -> {1, 1, 1}, 8 -> {-1, 1, 1}};
cubegraph = {UndirectedEdge[1, 2], UndirectedEdge[2, 3], UndirectedEdge[1, 4], UndirectedEdge[3, 4],
    UndirectedEdge[1, 5], UndirectedEdge[2, 6], UndirectedEdge[5, 6], UndirectedEdge[3, 7],
    UndirectedEdge[6, 7], UndirectedEdge[4, 8], UndirectedEdge[5, 8], UndirectedEdge[7, 8]};
ReOrderGraph[g0_] := Module[{g = g0, temp},
    temp = Table[UndirectedEdge[Min[First[k], Last[k]], Max[First[k], Last[k]]], {k, g}];
    temp = SortBy[temp, {First, Last}];
    temp
];
cubegraph = ReOrderGraph[cubegraph];
cubegraphsubsets = Subsets[cubegraph];
cubegraphsubsets = Rest[cubegraphsubsets];
RotateGraph[g0_, p0_] := Module[{g = g0, p = p0, res},
    If[Length[g] <= 0, Return[{}];];
    res = Table[UndirectedEdge[p[[First[k]]], p[[Last[k]]]], {k, g}];
    res = ReOrderGraph[res];
    res
];
cuberotations = {
    {1, 2, 3, 4, 5, 6, 7, 8},
    {2, 3, 4, 1, 6, 7, 8, 5},
    {4, 1, 2, 3, 8, 5, 6, 7},
    {5, 6, 2, 1, 8, 7, 3, 4},
    {4, 3, 7, 8, 1, 2, 6, 5},
    {5, 1, 4, 8, 6, 2, 3, 7},
    {2, 6, 7, 3, 1, 5, 8, 4},
    {3, 4, 1, 2, 7, 8, 5, 6},
    {6, 5, 8, 7, 2, 1, 4, 3},
    {8, 7, 6, 5, 4, 3, 2, 1},
    {1, 4, 8, 5, 2, 3, 7, 6},
    {1, 5, 6, 2, 4, 8, 7, 3},
    {6, 2, 1, 5, 7, 3, 4, 8},
    {3, 2, 6, 7, 4, 1, 5, 8},
    {6, 7, 3, 2, 5, 8, 4, 1},
    {8, 4, 3, 7, 5, 1, 2, 6},
    {3, 7, 8, 4, 2, 6, 5, 1},
    {8, 5, 1, 4, 7, 6, 2, 3},
    {7, 3, 2, 6, 8, 4, 1, 5},
    {5, 8, 7, 6, 1, 4, 3, 2},
    {2, 1, 5, 6, 3, 4, 8, 7},
    {4, 8, 5, 1, 3, 7, 6, 2},
    {7, 6, 5, 8, 3, 2, 1, 4},
    {7, 8, 4, 3, 6, 5, 1, 2}
};
isomorphcounts = Association[{}];
While[Length[cubegraphsubsets] > 0,
    k = First[cubegraphsubsets];
    temp = Table[RotateGraph[k, j], {j, cuberotations}];
    temp = DeleteDuplicates[temp];
    isomorphcounts[k] = Length[temp];
    cubegraphsubsets = Complement[cubegraphsubsets, temp];
];
isomorphgraphedgelist = Keys[isomorphcounts];
graphcnt = Table[0, {5}, {13}];
graphcnt[[1, 1]] += 1;
Do[
    graphcnt[[1 + Length[ConnectedComponents[k]], 1 + EdgeCount[k]]] += 1;
, {k, isomorphgraphedgelist}
];
graphcnt // MatrixForm
(* isomorphgraphs = Table[GraphPlot3D[k, VertexCoordinates -> vertexcoordinates, ViewProjection -> "Orthographic", VertexLabels -> "Name", Boxed -> True, PlotRange -> {{-17/16, 17/16}, {-17/16, 17/16}, {-17/16, 17/16}}], {k, isomorphgraphedgelist}]; *)
(* isomorphgraphs = Table[GraphPlot3D[k, VertexCoordinates -> vertexcoordinates, ViewProjection -> "Orthographic", Boxed -> False, PlotRange -> {{-17/16, 17/16}, {-17/16, 17/16}, {-17/16, 17/16}}], {k, isomorphgraphedgelist}]; *)
isomorphgraphs = Table[GraphPlot3D[k, VertexCoordinates -> vertexcoordinates, ViewProjection -> "Orthographic", Boxed -> True, BoxStyle -> Directive[Dashed, White], PlotRange -> {{-17/16, 17/16}, {-17/16, 17/16}, {-17/16, 17/16}}], {k, isomorphgraphedgelist}];
(* GraphicsGrid[Partition[isomorphgraphs, 15]] *)
(* GraphicsGrid[{Take[isomorphgraphs, {200, 202}]}] *)
(* Table[GraphPlot3D[k, VertexCoordinates -> vertexcoordinates, ViewProjection -> "Orthographic", VertexLabels -> "Name", Boxed -> True, PlotRange -> {{-17/16, 17/16}, {-17/16, 17/16}, {-17/16, 17/16}}], {k, Take[isomorphgraphedgelist, 140]}] *)
(* GraphPlot3D[isomorphgraphedgelist[[3]], VertexCoordinates -> vertexcoordinates, ViewProjection -> "Orthographic", VertexLabels -> "Name"] *)
(* GraphicsGrid[Partition[Take[isomorphgraphs, {200, 210}], 4]] *)
Take[isomorphgraphs, {200, 211}]

Second Version:
Clear["Global`*"];
vertexcoordinates = {1 -> {-1, -1, -1}, 2 -> {1, -1, -1}, 3 -> {1, 1, -1}, 4 -> {-1, 1, -1},
    5 -> {-1, -1, 1}, 6 -> {1, -1, 1}, 7 -> {1, 1, 1}, 8 -> {-1, 1, 1}};
cubegraph = {UndirectedEdge[1, 2], UndirectedEdge[2, 3], UndirectedEdge[1, 4], UndirectedEdge[3, 4],
    UndirectedEdge[1, 5], UndirectedEdge[2, 6], UndirectedEdge[5, 6], UndirectedEdge[3, 7],
    UndirectedEdge[6, 7], UndirectedEdge[4, 8], UndirectedEdge[5, 8], UndirectedEdge[7, 8]};
ReOrderGraph[g0_] := Module[{g = g0, temp},
    temp = Table[UndirectedEdge[Min[First[k], Last[k]], Max[First[k], Last[k]]], {k, g}];
    temp = SortBy[temp, {First, Last}];
    temp
];
cubegraph = ReOrderGraph[cubegraph];
cubegraphsubsets = Subsets[cubegraph];
cubegraphsubsets = Rest[cubegraphsubsets];
RotateGraph[g0_, p0_] := Module[{g = g0, p = p0, res},
    If[Length[g] <= 0, Return[{}];];
    res = Table[UndirectedEdge[p[[First[k]]], p[[Last[k]]]], {k, g}];
    res = ReOrderGraph[res];
    res
];
cuberotations = {
    {1, 2, 3, 4, 5, 6, 7, 8},
    {2, 3, 4, 1, 6, 7, 8, 5},
    {4, 1, 2, 3, 8, 5, 6, 7},
    {5, 6, 2, 1, 8, 7, 3, 4},
    {4, 3, 7, 8, 1, 2, 6, 5},
    {5, 1, 4, 8, 6, 2, 3, 7},
    {2, 6, 7, 3, 1, 5, 8, 4},
    {3, 4, 1, 2, 7, 8, 5, 6},
    {6, 5, 8, 7, 2, 1, 4, 3},
    {8, 7, 6, 5, 4, 3, 2, 1},
    {1, 4, 8, 5, 2, 3, 7, 6},
    {1, 5, 6, 2, 4, 8, 7, 3},
    {6, 2, 1, 5, 7, 3, 4, 8},
    {3, 2, 6, 7, 4, 1, 5, 8},
    {6, 7, 3, 2, 5, 8, 4, 1},
    {8, 4, 3, 7, 5, 1, 2, 6},
    {3, 7, 8, 4, 2, 6, 5, 1},
    {8, 5, 1, 4, 7, 6, 2, 3},
    {7, 3, 2, 6, 8, 4, 1, 5},
    {5, 8, 7, 6, 1, 4, 3, 2},
    {2, 1, 5, 6, 3, 4, 8, 7},
    {4, 8, 5, 1, 3, 7, 6, 2},
    {7, 6, 5, 8, 3, 2, 1, 4},
    {7, 8, 4, 3, 6, 5, 1, 2}
};
ReflectVertex[k_] := {7, 8, 5, 6, 3, 4, 1, 2}[[k]];
cubereflections = Table[Map[ReflectVertex, k], {k, cuberotations}];
cuberotations = Join[cuberotations, cubereflections];
isomorphcounts = Association[{}];
While[Length[cubegraphsubsets] > 0,
    k = First[cubegraphsubsets];
    temp = Table[RotateGraph[k, j], {j, cuberotations}];
    temp = DeleteDuplicates[temp];
    isomorphcounts[k] = Length[temp];
    cubegraphsubsets = Complement[cubegraphsubsets, temp];
];
isomorphgraphedgelist = Keys[isomorphcounts];
graphcnt = Table[0, {5}, {13}];
graphcnt[[1, 1]] += 1;
Do[
    graphcnt[[1 + Length[ConnectedComponents[k]], 1 + EdgeCount[k]]] += 1;
, {k, isomorphgraphedgelist}
];
graphcnt // MatrixForm
lewitts = Select[isomorphgraphedgelist, Length[ConnectedComponents[#]] == 1 &];
isomorphgraphs = Table[GraphPlot3D[k, VertexCoordinates -> vertexcoordinates, ViewProjection -> "Orthographic", Boxed -> True, BoxStyle -> Directive[Dashed, White], PlotRange -> {{-17/16, 17/16}, {-17/16, 17/16}, {-17/16, 17/16}}], {k, lewitts}];
isomorphgraphs


Yours Aye

Me

Drain times with Toricelli's law

 It's easy to calculate the drain time of water in a cylindrical tank using Toricelli's law, $v=\sqrt{2gh}$. In fact, using a simple differential equation, we can see that

$\displaystyle \sqrt{\frac{h}{H}}=1-\frac{t}{t_H}$

where $H$ is the initial height and $t_H$ is the time it takes for the tank to drain a water column of height $H$.

I got curious about the case when there is a constant inflow of water. Then, we have the differential equation,

$a\sqrt{2gh_0} \,dt-a\sqrt{2gh}\,dt=A\,dh$

where $a$ is the area of discharge, $A$ the cylindrical area and $h_0$ the measure of constant inflow. Solving this gives,

$\displaystyle \frac{t}{t_0}=\sqrt{H/h_0}-\sqrt{h/h_0}+\ln\left(\frac{1-\sqrt{H/h_0}}{1-\sqrt{h/h_0}}\right)$

where $t_0$ is the time taken to drain a water column of height $h_0$.

Plotting this shows that irrespective of the height of the water column we start with, we always end up with a steady state water column of height $h_0$.

This brings us to the next case. Suppose we have a tank with an initial water column of height $H$ which drains water into a identical tank. We know that the first tank takes time $t_H$ to drain completely and therefore, will be restricting our analysis to this timeframe.

In this case, the differential equation (using the first equation of this post) becomes

$\displaystyle a\sqrt{2gH}\left(1-\frac{t}{t_H}\right)\,dt-a\sqrt{2gh}\,dt=A\,dh$

This can be simplified to

$\displaystyle 1 - \frac{t}{t_H}-\sqrt{\frac{h}{H}}=\frac{t_H}{2H}\frac{dh}{dt}$

We now makes substitutions, $x=1 - t/t_H$ and $y=\sqrt{h/H}$ so that the above equation becomes

$\displaystyle y-x=y\frac{dy}{dx}$

Solving this homogenous differential equation, we get

$\displaystyle\ln(y^2-yx+x^2)+\frac{2}{\sqrt{3}}\tan^{-1}\left(\frac{2}{\sqrt{3}}\frac{y}{x}-\frac{1}{\sqrt{3}}\right)=C$

Let's see some special cases of height of the water column in the second tank when the first tank runs out of water.

If the second tank is empty to start with, we have $h=0,t=0 \implies y=0,x=1$ as the initial conditions. With this we get,

$\displaystyle\ln(y^2-yx+x^2)+\frac{2}{\sqrt{3}}\tan^{-1}\left(\frac{2}{\sqrt{3}}\frac{y}{x}-\frac{1}{\sqrt{3}}\right)=-\frac{\pi}{3\sqrt{3}}$

Putting $x=0$ in the above (to find the water column at $t=t_H$), we see that $\displaystyle h(t_H) =\exp\left(-\frac{4\pi}{3\sqrt{3}}\right)H$

Similarly, if the two tanks start with the same level from the start, we use the initial conditions $h=H,t=0 \implies y=1,x=1$. This time we get,

$\displaystyle\ln(y^2-yx+x^2)+\frac{2}{\sqrt{3}}\tan^{-1}\left(\frac{2}{\sqrt{3}}\frac{y}{x}-\frac{1}{\sqrt{3}}\right)=\frac{\pi}{3\sqrt{3}}$

Now, if we put $x=0$ in the above we get, $\displaystyle h(t_H) =\exp\left(-\frac{2\pi}{3\sqrt{3}}\right)H$

Finally, note that if the initial water level in the second tank is lower than that of the first tank, it's water level rises initially, reaches a maximum and then falls off.

To find the maximum height it reaches, we need $dh=0 \implies dy=0 \implies y=x$.

If we let $y_{\text{max}}$ to denote the maximum $y$ and $y_1$ to denote the value of $y$ at $x=1$, we see that

$\displaystyle\ln(y^2-yx+x^2)+\frac{2}{\sqrt{3}}\tan^{-1}\left(\frac{2}{\sqrt{3}}\frac{y}{x}-\frac{1}{\sqrt{3}}\right)=\ln y_1^2+\frac{\pi}{\sqrt{3}}$

Putting $y=x$ in the above, we have

$\displaystyle \ln y_{\text{max}}^2+\frac{\pi}{3\sqrt{3}}=\ln y_1^2+\frac{\pi}{\sqrt{3}}$

This then shows that

$\displaystyle h_{\text{max}}=\exp\left(\frac{2\pi}{3\sqrt{3}}\right)h_1$

While it was already surprising that both $\pi$ and $e$ made an appearance in this problem, this result that the max. height and final height are in a constant ratio made it all the more satisfying for me.


Until then

Yours Aye

Me