# Calculate the edge length of a cube, which is inserted in a hemisphere

How can I calculate the edge length of a cube, which is inserted into a half-sphere with a radius $a$?

-
Are you talking about a sphere or half-sphere? –  Sigur Aug 26 '12 at 15:06
You can use the Pythagorean theorem on the triangle whose hypotenuse is the hemisphere's radius, and one leg having the length of half the cube's face diagonal. –  Guess who it is. Aug 26 '12 at 15:06
a half-sphere___ –  HotPizzaBox Aug 26 '12 at 15:08

Imagine the half-sphere in $\Bbb R^3$, laying flat on the xy-plane. Let the side length of the cube be $r$.
The corners of the cube will touch the top of the half-sphere, so the length of a line from the origin to any top vertex of the cube will have length $a$, since this line is also the radius of the half-sphere. The line from the origin to a vertex on the xy-plane will be one-half the length of a diagonal on a face of the cube. Using the pythagorean theorem and letting the diagonal be $d$, we have that $d^2=r^2+r^2$ and so $d=\sqrt 2 r$, thus the line from the origin to the vertex on the xy-plane is $\frac 1 {\sqrt 2} r$. We have two sides of a triangle which has one vertex at the origin, one as a vertex of the cube on the xy-plane, and one as a top vertex of the cube. Using vertices of the cube which are on the same edge of the cube, we have that the last side of such a triangle has length $r$. Thus we just use the pythagorean theorem again:
$$r^2+\frac {r^2} 2 = a^2$$
Solving for $r$ in terms of $a$ gives the desired result.