How to calculate the height of an hcp lattice?
To calculate the height of a unit cell, consider a tetrahedral void in an hexagonal closed packing arrangement. It can be imagined as a 3 solid spheres touching each other and at the center-point, you have another sphere stacked over them. An interactive version can be viewed on this site. The situation looks like this:

 

If you join the centers of these four spheres, you'll get a tetrahedron. That's basically a pyramid with a triangular base. I'm assuming each edge of our tetrahedron to be equal to $a$.

Now, you have a pyramid ($ABCD$), with an equilateral base ($\Delta BCD$), I would like you to drop a perpendicular from the highest point ($A$) to the center ($G$) triangular base. If you're following me correctly, you'll have a figure like this:



All we have to do now is to calculate the length $AG$. For this, simply use the Pythagorean theorem in $\Delta AGD$.

$$ \begin{align*} AD^2 &amp;= AG^2 + GD^2 \tag{1} \end{align*} $$

Although we know that $AD=a$, the side $GD$ remains unknown. But that's easy to calculate. The point $G$ is the centroid of $\Delta BCD$. Thus, the length $GD$ equals $a/\sqrt{3}$. Pluggging in the values in our first equation, we get $AG=a \sqrt{\frac{2}{3}}$. But note, this is half the height of our unit cell. Thus, the required height is $2a \sqrt{\frac{2}{3}}$.