{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"[2015M217](http://colliand.com/2015M217/)\n",
"\n",
"#Vectors in Space\n",
"\n",
"* J. Colliander\n",
"* Stewart Text: 12.[1-5]\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"##Where are you? Where are you going?"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false,
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [
{
"data": {
"text/html": [
"\n",
" \n",
" "
],
"text/plain": [
""
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from IPython.display import YouTubeVideo\n",
"YouTubeVideo(\"zBlAGGzup48\")"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"\n",
"* $\\mathbb{R}^3$\n",
" * Cartesian coordinate system, right hand rule, coordinate planes\n",
" * Distance formula\n",
" * Sphere, Cylinder\n",
" * Other coordinate systems\n",
"\n",
"![Cartesian Coordinates](https://upload.wikimedia.org/wikipedia/commons/thumb/f/fd/3D_Vector.svg/300px-3D_Vector.svg.png)\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true,
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"\n",
"* Vectors ${\\bf{a}} = (a_x, a_y, a_z)$.\n",
"\t* magnitude and direction\n",
" * Vector Space\n",
" * vector addition\n",
" * ${\\bf{0}}$ vector\n",
" * multiplication by a scalar\n",
"\t* standard basis, unit vectors $\\bf{i}, \\bf{j}, \\bf{k}$, \n",
" * $\\mathbb{R}^d$ has standard basis $\\{ e^j \\}_{j=1}^d$."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Dot Product\n",
"\n",
"The `Dot Product` takes two vectors and returns a scalar: ${\\bf{a}}, {\\bf{b}} \\longmapsto {\\bf{a}}\\cdot {\\bf{b}}$.\n",
"\n",
"$${\\bf{a}}=\\langle a_1, a_2, a_3 \\rangle, {\\bf{b}}=\\langle b_1, b_2, b_3 \\rangle$$\n",
"\n",
"$${\\bf{a}} \\cdot {\\bf{b}} = a_1 b_1 + a_2 b_2 + a_3 b_3 $$\n",
"\n",
"`Direction Cosines`\n",
"\n",
"## Properties\n",
"\n",
"* `Orthogonal` vectors\n",
"\n",
"${\\bf{a}} \\perp {\\bf{b}}$, read ${\\bf{a}}$ is *orthogonal* to ${\\bf{b}}$, if ${\\bf{a}} \\cdot {\\bf{b}} = 0$.\n",
"\n",
"* cosine property\n",
"\n",
"${\\bf{a}} \\cdot {\\bf{b}} = |{\\bf{a}}||{\\bf{b}}| \\cos (\\theta).$ \n",
"\n",
"* *projections*\n",
"\n",
"![projection](https://upload.wikimedia.org/wikipedia/commons/thumb/3/3e/Dot_Product.svg/300px-Dot_Product.svg.png)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#Cross Product\n",
"\n",
"The *Cross Product* takes two vectors and returns a vector: \n",
"\n",
"![cross product](https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/Cross_product_parallelogram.svg/220px-Cross_product_parallelogram.svg.png)\n",
"\n",
"##Properties\n",
"\n",
"* Formula: $ {\\bf{a}} \\times {\\bf{b}} = \\langle a_2 b_3 - a_3 b_2, a_3 b_1 - a_1 b_3, a_1 b_2 - a_2 b_1 \\rangle $\n",
"* Determinants\n",
"* Parallelogram\n",
"\n",
"*Scalar Triple Product*\n",
"\n",
"* Parallelepiped\n",
"\n",
"![parallelepiped](https://upload.wikimedia.org/wikipedia/en/thumb/e/e6/Exterior_calc_triple_product.svg/220px-Exterior_calc_triple_product.svg.png)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"a = np.array([4,7,3]); b=np.array([0,1,1])"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"10"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.inner(a, b)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"array([ 4, -4, 4])"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.cross(a,b)\n"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"c = np.array([1,1,1])"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"4"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.inner(np.cross(a,b),c)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Equations of Lines and Planes"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"In $\\mathbb{R}^2$, we have the equation for a `line`:\n",
"$$ ax + by = c.$$\n",
"Of course, we can solve for $y$ to rewrite the equation in `slope-intercept form`:\n",
"$$by = c - ax$$\n",
"$$y = -\\frac{a}{b} x + \\frac{c}{b}.$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In $\\mathbb{R}^3$, we can form a similar expression and this describes a `plane`:\n",
"$$ a x + by + cz = d.$$\n",
"We can solve for $z$:\n",
"$$cz = d -ax - by$$\n",
"$$z = -\\frac{a}{c} x - \\frac{b}{c}y + \\frac{d}{c}$$\n",
"\n",
"Another natural way to express a `plane` is to normalize so that $d=1$. You can do this by dividing through by $d$."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Natural Questions!**\n",
"\n",
"* Which planes pass through the coordinate origin?\n",
"* Can you describe the points on a plane with equation $ax + by + cz = d$ which are also in the $(x,y)$-plane described by $z = 0$?\n",
"* Find the equation for the plane passing through three points.\n",
"* Find the equation passing through the point $P$ with coordinates $(f,g,h)$ which is perpindicular to ${\\bf{n}} = (1,2,3)$."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.3"
}
},
"nbformat": 4,
"nbformat_minor": 0
}