From ddf8e3ce17d8178cbadad9ad119a22ea2c4a11cd Mon Sep 17 00:00:00 2001 From: Daniel Falbo <39460524+danielfalbo@users.noreply.github.com> Date: Mon, 8 Apr 2024 15:04:18 +0200 Subject: [PATCH] Add interactive block of code from slide also adds claryfing comment and prints the output in degrees rather than radians to match the slides context --- .../03_math_recap_eig_pca_3dmm.ipynb | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/AA2324/course/03_math_recap_eig_pca_3dmm/03_math_recap_eig_pca_3dmm.ipynb b/AA2324/course/03_math_recap_eig_pca_3dmm/03_math_recap_eig_pca_3dmm.ipynb index 3a8d450..6d30bc7 100644 --- a/AA2324/course/03_math_recap_eig_pca_3dmm/03_math_recap_eig_pca_3dmm.ipynb +++ b/AA2324/course/03_math_recap_eig_pca_3dmm/03_math_recap_eig_pca_3dmm.ipynb @@ -34,7 +34,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": { "slideshow": { "slide_type": "skip" @@ -240,14 +240,35 @@ "The angle between $[1, 0]$ and $[0, 1]$ is 90.\n", "\n", "```python\n", - "is_basis = False\n", + "is_basis = False # toggle this to compare the angles\n", "X = np.array([[1, 0], [0, 1]]) if is_basis else np.array([[1, -1], [2, 3]])\n", "theta_rad = angle(*X)\n", "theta = theta_rad*180/np.pi\n", - "print(theta_rad)\n", + "print(theta)\n", "```" ] }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "101.30993247402021\n" + ] + } + ], + "source": [ + "is_basis = False # toggle this to compare the angles\n", + "X = np.array([[1, 0], [0, 1]]) if is_basis else np.array([[1, -1], [2, 3]])\n", + "theta_rad = angle(*X)\n", + "theta = theta_rad*180/np.pi\n", + "print(theta)" + ] + }, { "cell_type": "markdown", "metadata": { @@ -3357,7 +3378,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.13" + "version": "3.12.2" }, "latex_envs": { "LaTeX_envs_menu_present": true,