Skip to content

Commit

Permalink
Merge pull request #100 from danielfalbo/patch-1
Browse files Browse the repository at this point in the history
Add interactive block of code from slide
  • Loading branch information
iacopomasi authored Apr 8, 2024
2 parents d561291 + ddf8e3c commit e86f541
Showing 1 changed file with 25 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {
"slideshow": {
"slide_type": "skip"
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit e86f541

Please sign in to comment.