Imagine C has positive formal charge bonded to three methyl groups (CH3). How do we compute the overlap between sigma bond and empty $p$-orbital? The motivation for this is to show how energy stabilization (hyperconjugation) is proportional to dihedral angle $\theta$.
The carbon atoms $\text{sp}_3$-hybridize, which possesses tetrahedral geometry.
The state vector looks like
$$|\text{sp}_3\rangle = \frac{1}{2}|s\rangle +\frac{\sqrt 3}{2}\bigr(v_x|p_x\rangle + v_y|p_y\rangle + v_z|p_z\rangle\bigr)$$
Choose the origin $O = (0,0,0)$ to be the centroid of this tetrahedron and place the methyl carbon there. We require the C-C bond to lie along the $z$-axis. For ideal tetrahedral geometry, the unit vector $v$ pointing along a C-H bond forms an angle $\beta$ with the $z$-axis such that $\cos\beta = -1/3$. Choosing one C-H bond to start in the $xz$-plane, the bond vector is:
$$v = (\sin\beta, 0, \cos\beta) = \left(\frac{2\sqrt{2}}{3}, 0, -\frac{1}{3}\right)$$
Keeping the z-axis fixed, every rigid displacement corresponds to a rotation by $\theta$ about the $z$-axis. We can use Rodrigues’ formula for the rotated vector $v’$:
$$v’ = v \cos(\theta) + ( k \times v ) \sin(\theta) + k ( k \cdot v ) ( 1 − \cos(\theta))$$
Where the unit vector is $k = (0,0,1)$. We can compute as follows:
$$v' = \begin{bmatrix} v_x \cos\theta - v_y \sin\theta \\ v_x \sin\theta + v_y \cos\theta \\ v_z \end{bmatrix}$$
Substituting our specific C-H bond vector ($v_x = \frac{2\sqrt{2}}{3}, v_y = 0, v_x = -\frac{1}{3}$):
$$v' = \begin{bmatrix} \frac{2\sqrt{2}}{3} \cos\theta \\ \frac{2\sqrt{2}}{3} \sin\theta \\ -\frac{1}{3} \end{bmatrix}$$
Therefore the rotated $\text{sp}_3$ state is
$$|\text{sp}_3'\rangle = \frac{1}{2}|s\rangle + \frac{\sqrt{3}}{2} \Big[ v'_x|p_x\rangle + v'_y|p_y\rangle + v'_z |p_z\rangle \Big]$$
Then the overlap with the empty $p_x$ orbital of the cation ($|p_x^{(C^+)}\rangle$) is
$$\begin{aligned} S(\theta) &= \frac{1}{2} \langle p_x^{(C^+)} | s^{(Me)} \rangle + \frac{\sqrt{3}}{2} \Big[ v'_x \langle p_x^{(C^+)} | p_x^{(Me)} \rangle + v'_y \langle p_x^{(C^+)} | p_y^{(Me)} \rangle + v'_z \langle p_x^{(C^+)} | p_z^{(Me)} \rangle \Big] \\ \end{aligned} $$
Due to symmetry, the overlaps with $s, p_y,$ and $p_z$ vanish, leaving only the $p_x$-$p_x$ overlap ($S_{\pi}$):
$$\begin{aligned} S(\theta) &= \frac{\sqrt{3}}{2} v'_x S_{\pi} \\ &= \frac{\sqrt{3}}{2} \left( \frac{2\sqrt{2}}{3} \cos\theta \right) S_{\pi} \\ &= \sqrt{\frac{2}{3}} S_{\pi} \cos\theta \end{aligned}$$
Is this reasonable?