Vectors: Difference between revisions

From Physics Book
Jump to navigation Jump to search
No edit summary
Made dramatic changes to the organization, presentation and information contained in this page. There are new sections and a complete refactoring of all text. Issues with format visible in the original article have all been fixed. Additions: - Gave formal definitions and working examples of all that an introductory physics student should know about vectors. There are multiple new sections on this. - Introduced slightly more advanced topics regarding vectors and their use in mathematics/physics.
Line 1: Line 1:
'''John Yang -- Fall 2026'''
'''John Yang -- Fall 2026'''


==Vectors and Units Introduction==
==Introduction==


Vectors and units are core tools for describing the physical world in a precise, quantitative way. A vector is a quantity that has both **magnitude** (how big) and **direction** (which way). Many important physical quantities are vectors: displacement, velocity, acceleration, and force all need both size and direction to be completely specified. By representing these quantities as vectors, we can keep track of how they combine, cancel, and interact in one, two, or three dimensions.
Vectors and units are used for precisely describing the physical world. A vector in introductory physics can be thought of as a quantity that has both '''magnitude''' (how big) and '''direction''' (which way). Many important physical quantities are vectors: displacement, velocity, acceleration, and force all need both size and direction to be specified. By representing these quantities as vectors, we can keep track of how they interact.


Units, meanwhile, tell us **what** we are measuring. A number by itself has no physical meaning until we attach a unit such as meters (m), seconds (s), or newtons (N). Consistent use of units helps us spot mistakes, compare results, and communicate clearly. Together, vectors and units allow scientists, engineers, and programmers to build models that match real-world behavior and to carry out calculations that remain physically meaningful.
Units, meanwhile, tell us what we are measuring. A number by itself has no physical meaning until we attach a unit such as meters (m), seconds (s), or newtons (N). Consistent use of units helps us spot mistakes, compare results, and communicate clearly. Together, vectors and units allow scientists, engineers, and programmers to build models and make inferences and predictions for real-world behavior and to do computations that are physically meaningful.


In physics and engineering, vectors show up whenever we track motion, balance forces, or work with fields such as electric and magnetic fields. In computer science and related fields, vectors appear in computer graphics, simulations, game physics, machine learning, and data representation. Units ensure that all of these computations line up with real measurements rather than just abstract numbers. A strong grasp of both vectors and units is essential for solving problems, interpreting formulas, and understanding how different parts of a system relate to each other.
In physics and engineering, vectors show up whenever we track motion, balance forces, or work with fields such as electric and magnetic fields. In computer science and related fields, vectors appear in computer graphics, simulations, game physics, machine learning, and data representation. Units give meaning to these values and ensure that all of these computations line up with real measurements. A strong grasp of both vectors and units is essential for problem solving, interpreting relations, and understanding of physics in general.


Vectors are usually written using boldface letters or an arrow, such as '''v''' or <math>\vec{v}</math>. You may also see a vector written as a directed segment like <math>\overrightarrow{AB}</math>. Common vector quantities include displacement, velocity, force, and acceleration. Units provide the scale for these quantities and are based on standard systems like SI. For example, meters (m) measure length, kilograms (kg) measure mass, seconds (s) measure time, and newtons (N) measure force.
[[File:wikivector.png]]


[[File:2d3dvec.png|2D vector vs 3D vector]][[File:smallvector.png]]
===Notation Conventions===


==Unit Vector==
Introductory physics and pure mathematics often write the same vector concepts differently. Because this article bridges introductory physics and formal linear algebra, the table below summarizes both conventions and states the standard used on this page:


A **unit vector** is a vector whose magnitude is exactly 1 (one unit) but that still points in a particular direction. Unit vectors are useful for representing direction independently of size. They are often used to define coordinate directions (such as the x, y, and z axes) and to rewrite any vector as “magnitude × direction.”
{| class="wikitable"
! Concept !! Linear Algebra !! Introductory Physics !! Convention in This Article
|-
| Vector || <math>v</math> (plain italic; distinguished by context) || <math>\vec{v}</math>, <math>\mathbf{v}</math>, or <math>\overrightarrow{AB}</math> || <math>v</math> in abstract definitions; <math>\vec{v}</math> in physics and <math>\mathbf{R}^3</math>
|-
| Coordinate tuple (vector in <math>\mathbf{R}^3</math>) || <math>(v_x, v_y, v_z)</math> || <math>\langle v_x, v_y, v_z \rangle</math> or <math>(v_x, v_y, v_z)</math> || <math>(v_x, v_y, v_z)</math>
|-
| Inner product (dot product) || <math>\langle u, v \rangle</math> || <math>\vec{u} \cdot \vec{v}</math> || <math>\langle u, v \rangle</math> (and <math>\vec{u} \cdot \vec{v}</math> in <math>\mathbf{R}^n</math>)
|-
| Norm (magnitude) || <math>\|v\|</math> || <math>|\vec{v}|</math>, <math>v</math>, or <math>\|\vec{v}\|_2</math> || <math>\|v\|</math> or <math>\|\vec{v}\|</math>
|-
| Unit vector || <math>u</math> with <math>\|u\| = 1</math> || <math>\hat{v}</math>; standard basis <math>\hat{i}, \hat{j}, \hat{k}</math> or <math>\hat{x}, \hat{y}, \hat{z}</math> || <math>\hat{v}</math> and <math>\hat{i}, \hat{j}, \hat{k}</math> (or <math>\hat{x}, \hat{y}, \hat{z}</math>)
|}


[[File:unitvecexp.png]]
'''Important note on angle brackets (<math>\langle \cdot, \cdot \rangle</math>):''' Many introductory physics textbooks and computational tools (including VPython's printed output) write coordinate vectors using angle brackets, such as <math>\vec{v} = \langle 3, -1, 2 \rangle</math>, to visually separate vectors from points <math>(3, -1, 2)</math>. In mathematics and nonintroductory physics, however, this is an '''abuse of notation''': angle brackets <math>\langle u, v \rangle</math> are reserved for the '''inner product''' of two vectors, which outputs a scalar rather than a vector. Writing both <math>\vec{v} = \langle v_x, v_y \rangle</math> and <math>\langle u, v \rangle</math> in the same setting creates ambiguity (especially in 2D, where both take two entries). To be unambiguous, this article strictly uses '''parentheses''' <math>(v_x, v_y, v_z)</math> for coordinate tuples and '''angle brackets''' <math>\langle u, v \rangle</math> exclusively for inner products.


==Magnitude==
===Physical Examples and Visual Representation===


The **magnitude** of a vector is the length or size of the vector. For a vector <math>\vec{v}</math>, the magnitude is written as <math>|\vec{v}|</math>. Magnitude is always a non-negative scalar. In 2D and 3D, it is usually computed with the Pythagorean theorem, using the vector’s components.
====Position and Displacement====


[[File:vec3.png]]
A point's location in 3D space is described by a '''position vector''' <math>\vec{r} \in \mathbf{R}^3</math> measured from a chosen origin <math>(0, 0, 0)</math>. Because position depends on where the origin is placed, a position vector is always anchored to a reference point. Given two position vectors <math>\vec{r}_1</math> and <math>\vec{r}_2</math>, their difference


==Direction==
<math>\Delta \vec{r} = \vec{r}_2 - \vec{r}_1</math>


The **direction** of a vector describes how it is oriented in space. It can be specified relative to axes (such as the angle from the positive x-axis), using unit vectors, or using geometric descriptions (like “30° above the horizontal” or “to the south”).
is the '''relative position''' (or '''displacement''') vector pointing from point 1 to point 2. Unlike position itself, displacement is independent of the choice of origin, and its norm <math>\|\vec{r}_2 - \vec{r}_1\|</math> equals the straight-line Euclidean distance between the two points.


[[File:directionvec.png]]
====Velocity====
[[File:vec10.png]]


==Addition and Subtraction==
'''Velocity''' is a vector that describes how fast and in what direction an object moves. Its magnitude is the '''speed''', and it is usually measured in m/s. The velocity vector can be found by differentiating the position vector with respect to time (if the position function is differentiable, that is).


Vectors can be added or subtracted to form new vectors. Geometrically, we often use the **head-to-tail method** or the **parallelogram rule**. In component form, vector addition and subtraction are done by adding or subtracting corresponding components.
<math>\vec{v}(t) = \frac{d\vec{r}}{dt}</math>


[[File:vec4.png]]
For example, if <math>\vec{r}(t) = (t, 1, 0)\ \text{m}</math>, then:


==Scalar Multiplication==
<math>\vec{v}(t) = \frac{d\vec{r}}{dt} = (1, 0, 0)\ \text{m/s}</math>


**Scalar multiplication** means multiplying a vector by a scalar (a regular number). This produces a new vector in the same or opposite direction, but with its magnitude scaled by the scalar. This is used to stretch, shrink, or reverse vectors in many physical and mathematical problems.
The speed is the norm <math>\|\vec{v}(t)\| = \sqrt{1^2 + 0^2 + 0^2} = 1\ \text{m/s}</math>.


[[File:vec5.png]]
[[File:Velwiki.png]]


==Dot Product==
====Weight====


The **dot product** (or scalar product) of two vectors produces a scalar. It can be written in terms of components or in terms of magnitudes and the cosine of the angle between the vectors. Dot products are used to find angles between vectors, project one vector onto another, and calculate physical quantities such as work.
Near Earth's surface, gravity exerts a downward force vector <math>\vec{F}_g</math> on an object of mass <math>m > 0</math>. Choosing a coordinate system with the positive <math>y</math>-axis pointing upward,


[[File:vec7.png]]
<math>\vec{F}_g = (0, -mg, 0)</math>


==Cross Product==
where <math>g \approx 9.8\ \text{m/s}^2</math> is the magnitude of the gravitational field near Earth’s surface. '''Weight''' refers to the norm <math>\|\vec{F}_g\| = mg</math> whereas <math>\vec{F}_g</math> is the gravitational force vector.


The **cross product** (or vector product) of two vectors in 3D produces a new vector that is perpendicular to both original vectors. Its magnitude equals the product of the magnitudes of the two vectors times the sine of the angle between them. Cross products appear in torque, angular momentum, and magnetic force, among other topics in rotational and field-based physics.
====Visualizing Vectors====


[[File:vec8.png]]
In <math>\mathbf{R}^2</math> and <math>\mathbf{R}^3</math>, vectors are drawn as '''arrows''': the length of the arrow represents the norm, and the direction of the arrow indicates which way it points. Mathematically, vectors in <math>\mathbf{R}^n</math> are invariant under parallel translation: sliding an arrow without changing its length or orientation produces the same vector. In physics, this invariance is useful because a vector does not always represent a literal displacement between two locations. It often describes a physical property defined at a single point (such as velocity, force, or an electric field). In diagrams, we anchor the tail of such a vector at the point where it acts.


For two vectors <math>\vec{A}</math> and <math>\vec{B}</math>, the magnitude of the cross product is
The example below shows a velocity vector for a ball moving to the right at 5 m/s.
<math>|\vec{A}\times\vec{B}| = |\vec{A}|\;|\vec{B}|\sin(\theta)</math>, 
where <math>\theta</math> is the angle between them. The direction follows the **right-hand rule**.


Some useful properties of the cross product:
[[File:Vectorvisualrepresentation.png]]
 
* It is **not commutative**: <math>\vec{A}\times\vec{B} \neq \vec{B}\times\vec{A}</math>. In fact, <math>\vec{A}\times\vec{B} = -(\vec{B}\times\vec{A})</math>.
* It is **distributive** over addition: <math>\vec{A}\times(\vec{B} + \vec{C}) = \vec{A}\times\vec{B} + \vec{A}\times\vec{C}</math>.
* The cross product of a vector with itself is zero: <math>\vec{A}\times\vec{A} = \vec{0}</math>, since the angle between a vector and itself is 0 and <math>\sin(0) = 0</math>.
 
==SI Units==
 
The **International System of Units (SI)** is the main measurement system used in science and engineering. It specifies seven base units from which all other units are built:
 
* meter (m) – length 
* kilogram (kg) – mass 
* second (s) – time 
* ampere (A) – electric current 
* kelvin (K) – temperature 
* mole (mol) – amount of substance 
* candela (cd) – luminous intensity 
 
All physical vector quantities you encounter in this class will use combinations of these units.
 
[[File:vec11.png]]
 
==Derived Units==
 
**Derived units** are units formed by combining base units through multiplication and division. For example:
 
* newton (N) = kg·m/s<sup>2</sup> (force) 
* joule (J) = N·m (energy) 
* watt (W) = J/s (power) 
 
These units describe more complex physical quantities but are always traceable back to the SI base units.
 
==Conversion==
 
**Unit conversion** means changing a quantity from one set of units to another while representing the same physical amount. For example, converting from centimeters to meters or from kilometers per hour to meters per second. In multi-step physics problems, careful unit conversion is essential to avoid errors and to match the units expected in formulas.


==Applications==
==Units and Measurement==


Vectors and units appear in many areas:
===SI Base Units===


* **Physics:** describing motion, forces, fields (electric, magnetic, gravitational), and momentum. 
The '''International System of Units (SI)''' is the standard measurement system in science and engineering. It defines seven base units from which all other SI units are constructed:
* **Engineering:** analyzing structures, designing mechanical systems, working with fluid flow, and modeling electrical circuits. 
* **Computer Graphics:** representing positions, directions, lighting, and transformations in 2D and 3D scenes.
* **Navigation:** expressing position, velocity, and direction in GPS systems and for aircraft or ships.


Understanding how vectors and units work together lets us build accurate models and interpret real-world data correctly.
* '''meter''' (<math>\text{m}</math>) – length
* '''kilogram''' (<math>\text{kg}</math>) – mass
* '''second''' (<math>\text{s}</math>) – time
* '''ampere''' (<math>\text{A}</math>) – electric current
* '''kelvin''' (<math>\text{K}</math>) – thermodynamic temperature
* '''mole''' (<math>\text{mol}</math>) – amount of substance
* '''candela''' (<math>\text{cd}</math>) – luminous intensity


_________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
All vector quantities in introductory physics carry combinations of these base units.


==What is a Vector?==
===Derived Units===


In mathematics and physics, a **vector** is a quantity that has both a magnitude and a direction.
'''Derived units''' are formed by combining SI base units through multiplication and division. Common examples include:


In coordinates, we often write a vector as a list of components. For example, in a 3D coordinate system, we might write:
* '''newton''' (<math>\text{N} = \text{kg}\cdot\text{m/s}^2</math>) – force
<math>\vec{v} = \langle v_x, v_y, v_z \rangle</math>
* '''joule''' (<math>\text{J} = \text{N}\cdot\text{m} = \text{kg}\cdot\text{m}^2/\text{s}^2</math>) – energy and work
* '''watt''' (<math>\text{W} = \text{J/s}</math>) – power
* '''tesla''' (<math>\text{T} = \text{N}\cdot\text{s}/(\text{C}\cdot\text{m}) = \text{kg}/(\text{A}\cdot\text{s}^2)</math>) – magnetic field


Here:
===Unit Conversion and Dimensional Consistency===


* <math>v_x</math> is the x-component of the vector,
'''Unit conversion''' changes a quantity from one unit to another while representing the same physical amount (for example, converting from centimeters to meters or from kilometers per hour to meters per second). In multi-step physics problems, careful unit conversion is essential to avoid errors and to match the units expected in formulas. In vector calculations, dimensional consistency requires that every coordinate of a vector shares the same unit.
* <math>v_y</math> is the y-component,
* <math>v_z</math> is the z-component.


A vector can also be written as a boldface letter, such as '''a''', or with an arrow, like <math>\vec{a}</math>. The specific letter used often reflects the quantity: <math>\vec{v}</math> for velocity, <math>\vec{r}</math> for position, etc. Individual components of a vector are written with subscripts, such as <math>c_x</math> or <math>q_y</math>.
==Formal Definition==


====Example of a Simple Vector====
===Vector Space Axioms===


<math>\vec{v} = \langle 1, 0, 0 \rangle</math>
Formally, a '''vector''' (or '''point''') is an element of a '''vector space'''. Let <math>\mathbf{F}</math> denote either the field of real numbers <math>\mathbf{R}</math> or the field of complex numbers <math>\mathbf{C}</math> (in introductory physics, <math>\mathbf{F} = \mathbf{R}</math>); elements of <math>\mathbf{F}</math> are called '''scalars'''.


This vector has magnitude 1 and points along the positive x-direction in 3D space.
A '''vector space''' over <math>\mathbf{F}</math> is a set <math>V</math> equipped with two operations:
* '''Addition''' (<math>V \times V \to V</math>): assigns an element <math>u + v \in V</math> to each pair <math>u, v \in V</math>.
* '''Scalar multiplication''' (<math>\mathbf{F} \times V \to V</math>): assigns an element <math>\lambda v \in V</math> to each <math>\lambda \in \mathbf{F}</math> and <math>v \in V</math>.


===Magnitude===
(Because both operations map back into <math>V</math>, closure under addition and scalar multiplication is built directly into the definition.) These operations must satisfy the following axioms for all <math>u, v, w \in V</math> and all <math>a, b \in \mathbf{F}</math>:
* '''Commutativity:''' <math>u + v = v + u</math>
* '''Associativity:''' <math>(u + v) + w = u + (v + w)</math> and <math>(ab)v = a(bv)</math>
* '''Additive identity:''' There exists an element <math>0 \in V</math> (the '''zero vector''', distinct from the scalar <math>0 \in \mathbf{F}</math>) such that <math>v + 0 = v</math>
* '''Additive inverse:''' For every <math>v \in V</math>, there exists <math>w \in V</math> such that <math>v + w = 0</math>
* '''Multiplicative identity:''' <math>1v = v</math>
* '''Distributivity:''' <math>a(u + v) = au + av</math> and <math>(a + b)v = av + bv</math>


The **magnitude** (or length) of a vector tells us how large the vector is.
From these axioms, we can prove that the additive identity <math>0 \in V</math> is unique, every vector <math>v \in V</math> has a unique additive inverse denoted <math>-v</math>, and <math>(-1)v = -v</math> and <math>0v = 0</math> for every <math>v \in V</math> (do these as an exercise).


We denote the magnitude of <math>\vec{v}</math> using vertical bars:
In introductory physics, we almost always work in the real vector spaces <math>\mathbf{R}^2</math> (the plane) or <math>\mathbf{R}^3</math> (ordinary 3D space), which are special cases of <math>\mathbf{R}^n</math>—the set of all ordered lists of <math>n</math> real numbers, such as <math>v = (v_x, v_y, v_z) \in \mathbf{R}^3</math>, with coordinate-wise addition and scalar multiplication. For example, <math>v = (1, 0, 0) \in \mathbf{R}^3</math> is a vector of length <math>1</math> pointing along the positive <math>x</math>-axis.
<math>|\vec{v}|</math>. You might also see notations such as <math>\overline{v}</math> or <math>\lVert\vec{v}\rVert_2</math> (the Euclidean norm).


In a 3D system, if
===Inner Products and Norms===
<math>\vec{v} = \langle v_x, v_y, v_z \rangle</math>, 
then its magnitude is


<math>\lVert \vec{v} \rVert = \sqrt{v_x^2 + v_y^2 + v_z^2}.</math>
A general vector space does not necessarily include a notion of length or angle. To introduce geometry, we equip a real vector space <math>V</math> with an '''inner product''', which is a function assigning a real scalar <math>\langle u, v \rangle \in \mathbf{R}</math> to each pair <math>u, v \in V</math> such that, for all <math>u, v, w \in V</math> and <math>\lambda \in \mathbf{R}</math>:
* '''Positive definiteness:''' <math>\langle v, v \rangle \ge 0</math>, with <math>\langle v, v \rangle = 0</math> if and only if <math>v = 0</math>.
* '''Linearity in the first slot:''' <math>\langle u + w, v \rangle = \langle u, v \rangle + \langle w, v \rangle</math> and <math>\langle \lambda u, v \rangle = \lambda \langle u, v \rangle</math>.
* '''Symmetry:''' <math>\langle u, v \rangle = \langle v, u \rangle</math> (which, combined with linearity in the first slot, also guarantees linearity in the second slot).


More generally, in n dimensions,
A vector space equipped with an inner product is called an '''inner product space'''. In <math>\mathbf{R}^n</math>, the standard '''Euclidean inner product''' (which we call the '''dot product''') of <math>u = (u_1, \dots, u_n)</math> and <math>v = (v_1, \dots, v_n)</math> is defined by:
<math>\lVert \vec{v} \rVert = \sqrt{v_1^2 + v_2^2 + \cdots + v_n^2}.</math>


The magnitude carries the units of the quantity being represented. For example, the magnitude of a velocity vector is speed and has units of m/s.
<math>\langle u, v \rangle = u_1 v_1 + u_2 v_2 + \cdots + u_n v_n = \sum_{i=1}^{n} u_i v_i</math>


Note that a vector does not always represent a literal “arrow in space” between two locations. Often, a vector describes a property at a single point (like electric field at a location) or in an abstract space, even though the mathematics is the same.
From the inner product, we define the '''norm''' (commonly called '''magnitude''' in physics) of a vector <math>v \in \mathbf{R}^n</math> as the nonnegative scalar:


[[File:IMG_0325613.jpg|400px|Image: 400 pixels]]
<math>\|v\| = \sqrt{\langle v, v \rangle} = \sqrt{v_1^2 + v_2^2 + \cdots + v_n^2} = \sqrt{\sum_{i=1}^{n} v_i^2}</math>


====Unit Vector====
In 3D Cartesian space, for <math>v = (v_x, v_y, v_z) \in \mathbf{R}^3</math>, this is the familiar Pythagorean formula:


If we divide a nonzero vector by its magnitude, we obtain a **unit vector** in the same direction:
<math>\|v\| = \sqrt{v_x^2 + v_y^2 + v_z^2}</math>


<math>\hat{v} = \frac{\vec{v}}{\lVert \vec{v} \rVert}</math>.
====Unit Vectors====


For example, if <math>\vec{v} = \langle v_x, v_y, v_z \rangle</math>, then
A '''unit vector''' is a vector with norm <math>1</math>. For any nonzero vector <math>v \in \mathbf{R}^n</math>, scaling <math>v</math> by the positive scalar <math>\frac{1}{\|v\|}</math> yields a unit vector in the same direction (a process called '''normalization'''):


<math>\hat{v} = \frac{1}{\lVert\vec{v}\rVert}\langle v_x, v_y, v_z \rangle.</math>
<math>\hat{v} = \frac{1}{\|v\|}v</math>


Unit vectors are written with a “hat,” such as <math>\hat{v}</math>. In many coordinate systems, there are standard unit vectors. In 3D Cartesian coordinates, the unit vectors along the axes are
For example, if <math>\vec{v} = (v_x, v_y, v_z) \in \mathbf{R}^3</math> is nonzero, then <math>\hat{v} = \frac{1}{\|\vec{v}\|}(v_x, v_y, v_z)</math>. Note that unit vectors carry no physical units because the units of <math>\vec{v}</math> and <math>\|\vec{v}\|</math> cancel.


<math>\hat{x} = \langle 1, 0, 0 \rangle, \quad \hat{y} = \langle 0, 1, 0 \rangle, \quad \hat{z} = \langle 0, 0, 1 \rangle.</math>
===Orthonormal Bases===


Other coordinate systems use different unit vectors, like <math>\hat{r}</math> and <math>\hat{\theta}</math> in polar coordinates.
Two vectors <math>u, v</math> in an inner product space are called '''orthogonal''' if <math>\langle u, v \rangle = 0</math>. A list of vectors <math>e_1, \dots, e_n</math> is '''orthonormal''' if every vector has norm <math>1</math> and every pair of distinct vectors is orthogonal (<math>\langle e_j, e_k \rangle = 0</math> for <math>j \neq k</math>).


===Direction===
The '''standard basis''' of <math>\mathbf{R}^3</math> is an '''orthonormal basis''' consisting of the three unit vectors:


The **direction** of a vector tells us which way it points.
<math>\hat{x} = (1, 0, 0), \qquad \hat{y} = (0, 1, 0), \qquad \hat{z} = (0, 0, 1)</math>


In 2D, we usually measure direction by an angle from the positive x-axis. For a vector <math>\vec{v} = \langle v_x, v_y \rangle</math>, the direction angle <math>\theta</math> can be computed as
(also sometimes written <math>\hat{i}, \hat{j}, \hat{k}</math> in physics and engineering). We can think of a basis as a fundamental list of vectors for a vector space that gives each component its meaning. For the standard basis, our list gives each component a meaning that it is the x, y, or z direction. This basis is orthonormal, so every vector <math>v \in \mathbf{R}^3</math> can be written uniquely as a linear combination whose coefficients are simply the inner products of <math>v</math> with each basis vector:


<math>\theta = \arctan\left(\frac{v_y}{v_x}\right)</math>,
<math>v = \langle v, \hat{x} \rangle \hat{x} + \langle v, \hat{y} \rangle \hat{y} + \langle v, \hat{z} \rangle \hat{z}</math>


keeping track of the correct quadrant.
Other coordinate systems use different local orthonormal bases that vary with position, such as <math>\hat{r}</math> and <math>\hat{\theta}</math> in polar coordinates.


===Simple Examples of Vector Quantities===
===Direction and Angles===


====Position====
In <math>\mathbf{R}^2</math> and <math>\mathbf{R}^3</math>, scalar multiplication gives a direct geometric interpretation of direction: for a nonzero <math>v</math>, multiplying by <math>\lambda > 0</math> scales its norm without changing its direction, while multiplying by <math>\lambda < 0</math> reverses its direction (with <math>(-1)v = -v</math> pointing directly opposite to <math>v</math>). The zero vector <math>0 = (0, \dots, 0)</math> has norm <math>0</math> and '''no direction'''.


A point’s position can be written as a vector. If we have two position vectors, subtracting them gives the **relative position** from one point to the other. The magnitude of this relative position vector gives the straight-line distance between the two points. A common special case is the position relative to the origin, where the origin is at <math>\langle 0,0,0\rangle</math>.
To quantify relative direction between any two nonzero vectors <math>u, v \in \mathbf{R}^n</math>, we rely on the '''Cauchy–Schwarz inequality''':


====Velocity====
<math>|\langle u, v \rangle| \le \|u\|\|v\|</math>


**Velocity** is a vector that describes how fast and in what direction an object moves. Its magnitude is the **speed**, and it is usually measured in m/s. The velocity vector can be found by differentiating the position vector with respect to time.
Dividing by <math>\|u\|\|v\| > 0</math> guarantees that <math>-1 \le \frac{\langle u, v \rangle}{\|u\|\|v\|} \le 1</math>. Because of this, there exists a unique '''angle''' <math>\theta \in [0, \pi]</math> between <math>u</math> and <math>v</math> where:


For example, let <math>\vec{r}(t) = \langle t, 1, 0 \rangle\ \text{m}</math>. Then the velocity is
<math>\cos\theta = \frac{\langle u, v \rangle}{\|u\|\|v\|}</math>


<math>\vec{v}(t) = \frac{d\vec{r}}{dt} = \langle 1, 0, 0 \rangle\ \text{m/s}.</math>
Two nonzero vectors are orthogonal (<math>\langle u, v \rangle = 0</math>) if and only if <math>\cos\theta = 0</math>, meaning they are '''perpendicular''' (<math>\theta = \frac{\pi}{2}</math>).


The speed is the magnitude of <math>\vec{v}</math>, which in this case is 1 m/s.
'''Unsigned angle vs. 2D polar direction angle:''' Notice that the inner-product angle <math>\theta = \arccos\left(\frac{\langle v, \hat{x}\rangle}{\|v\|}\right) = \arccos\left(\frac{v_x}{\|v\|}\right)</math> always lies in <math>[0, \pi]</math> and therefore cannot distinguish whether a 2D vector points above or below the <math>x</math>-axis (it loses the sign of <math>v_y</math>). In introductory 2D physics, we instead specify a vector's full orientation using a '''signed polar direction angle''' <math>\phi \in (-\pi, \pi]</math> (or <math>[0, 2\pi)</math>) measured counterclockwise from the positive <math>x</math>-axis. For a nonzero vector <math>v = (v_x, v_y) \in \mathbf{R}^2</math>:
 
* If <math>v_x > 0</math>: <math>\phi = \arctan\left(\frac{v_y}{v_x}\right)</math>.
[[File:Velwiki.png]]
* If <math>v_x < 0</math>: <math>\phi = \arctan\left(\frac{v_y}{v_x}\right) + \pi</math> (or <math>-\pi</math>, depending on the chosen branch) to place <math>\phi</math> in the second or third quadrant.
 
* If <math>v_x = 0</math>: <math>\phi = \frac{\pi}{2}</math> (<math>90^\circ</math>) when <math>v_y > 0</math>, and <math>\phi = -\frac{\pi}{2}</math> (<math>270^\circ</math>) when <math>v_y < 0</math>.
====Weight (Force of Gravity)====
 
Weight is the gravitational force acting on an object; it is a vector that typically points downward. We often write the gravitational force as <math>\vec{F_g}</math>. In a coordinate system where +y is upward, we can write:
 
<math>\vec{F_g} = \langle 0, -mg, 0 \rangle,</math>
 
where <math>m</math> is the mass of the object and <math>g = 9.8~\text{m/s}^2</math> is the magnitude of the gravitational field near Earth’s surface. The magnitude <math>|\vec{F_g}| = mg</math> is the weight of the object.
 
===Visually Representing Vectors===
 
Vectors are often drawn as **arrows**. The length of the arrow represents the magnitude, and the direction of the arrow shows which way the vector points. If a vector is tied to a particular location, the tail of the arrow is drawn at that point.
 
The example below shows a velocity vector for a ball moving to the right at 5 m/s.
 
[[File:Vectorvisualrepresentation.png]]


==Vector Operations==
==Vector Operations==


We can perform several operations on vectors, both with other vectors and with scalars. These operations are used constantly in physics and engineering. To keep the notation simple, we will describe them for 3D vectors, but they generalize naturally to higher dimensions.
Vector addition and scalar multiplication are built into every vector space. The dot product and cross product add geometric structure for measuring projections, angles, areas, and orientations. Below, formulas are written in <math>\mathbf{R}^3</math> for introductory physics, with notes on how they generalize to <math>\mathbf{R}^n</math>.


===Addition===
===Addition and Subtraction===


For vectors <math>\vec{a} = \langle a_x, a_y, a_z \rangle</math> and <math>\vec{b} = \langle b_x, b_y, b_z \rangle</math>,
In <math>\mathbf{R}^n</math>, vector addition is defined coordinate-wise. For <math>\vec{a} = (a_x, a_y, a_z)</math> and <math>\vec{b} = (b_x, b_y, b_z)</math> in <math>\mathbf{R}^3</math>:


<math>\vec{a} + \vec{b} = \langle a_x + b_x,\; a_y + b_y,\; a_z + b_z \rangle.</math>
<math>\vec{a} + \vec{b} = (a_x + b_x,\; a_y + b_y,\; a_z + b_z)</math>


Geometrically, we place the tail of <math>\vec{b}</math> at the head of <math>\vec{a}</math>. The vector from the tail of <math>\vec{a}</math> to the head of <math>\vec{b}</math> is the **resultant** <math>\vec{a} + \vec{b}</math>.
By the vector space axioms, addition is commutative (<math>\vec{a} + \vec{b} = \vec{b} + \vec{a}</math>) and associative (<math>(\vec{a} + \vec{b}) + \vec{c} = \vec{a} + (\vec{b} + \vec{c})</math>). Geometrically, placing the tail of <math>\vec{b}</math> at the head of <math>\vec{a}</math> yields the '''resultant''' vector <math>\vec{a} + \vec{b}</math>, running from the tail of <math>\vec{a}</math> to the head of <math>\vec{b}</math>.


[[File:Vectoraddition.png|600px]]
[[File:Vectoraddition.png|600px]]


===Subtraction===
Every vector <math>\vec{b}</math> has a unique additive inverse <math>-\vec{b} = (-1)\vec{b}</math>, which has the same norm as <math>\vec{b}</math> but points in the opposite direction. '''Vector subtraction''' is formally defined as adding this additive inverse; for 3-dimensional vectors:


Vector subtraction can be viewed as adding the negative of a vector. We have
<math>\vec{a} - \vec{b} = \vec{a} + (-\vec{b}) = (a_x - b_x,\; a_y - b_y,\; a_z - b_z)</math>
 
<math>\vec{a} - \vec{b} = \vec{a} + (-\vec{b}) = \langle a_x - b_x,\; a_y - b_y,\; a_z - b_z \rangle.</math>
 
Component-wise, we subtract each component of <math>\vec{b}</math> from the corresponding component of <math>\vec{a}</math>.


[[File:IMG_0326.jpg|500px|Image: 500 pixels]]
[[File:IMG_0326.jpg|500px|Image: 500 pixels]]


===Multiplication by Scalar===
===Scalar Multiplication===


If <math>k</math> is a scalar and <math>\vec{a} = \langle a_x, a_y, a_z \rangle</math>, then
For a scalar <math>\lambda \in \mathbf{R}</math> and a vector <math>\vec{a} = (a_x, a_y, a_z) \in \mathbf{R}^3</math>, scalar multiplication multiplies every coordinate by <math>\lambda</math>:


<math>k \vec{a} = \langle k a_x,\; k a_y,\; k a_z \rangle.</math>
<math>\lambda \vec{a} = (\lambda a_x,\; \lambda a_y,\; \lambda a_z)</math>


Multiplying by a positive scalar changes the magnitude but keeps the direction the same. Multiplying by a negative scalar flips the direction as well.
This scales the norm by <math>|\lambda|</math> (that is, <math>\|\lambda \vec{a}\| = |\lambda|\|\vec{a}\|</math>). If <math>\lambda > 0</math>, direction is preserved; if <math>\lambda < 0</math>, direction is reversed; if <math>\lambda = 0</math>, the result is the zero vector <math>\vec{0}</math>.


[[File:Vectorscalarmultiplication.png|400px]]                           [[File:IMG_0327.jpg|400px|Image: 400 pixels]]
[[File:Vectorscalarmultiplication.png|400px]] [[File:IMG_0327.jpg|400px|Image: 400 pixels]]


===Division by Scalar===
Vector spaces do not include a separate "division by a scalar" axiom (nor is division by a vector defined). Instead, because every nonzero scalar <math>\lambda \in \mathbf{R}</math> has a unique multiplicative inverse <math>\frac{1}{\lambda} \in \mathbf{R}</math>, dividing a vector by <math>\lambda \neq 0</math> is simply scalar multiplication by <math>\frac{1}{\lambda}</math>:


Dividing a vector by a nonzero scalar is equivalent to multiplying by its reciprocal:
<math>\frac{\vec{a}}{\lambda} = \frac{1}{\lambda}\vec{a} = \left(\frac{a_x}{\lambda},\; \frac{a_y}{\lambda},\; \frac{a_z}{\lambda}\right)</math>


<math>\frac{\vec{a}}{k} = \langle \frac{a_x}{k},\; \frac{a_y}{k},\; \frac{a_z}{k} \rangle.</math>
===Dot Product===


This operation shrinks or enlarges the vector’s magnitude while preserving (or reversing, if k is negative) its direction.
The '''dot product''' (or '''scalar product''') is the Euclidean inner product on <math>\mathbf{R}^n</math>. For <math>\vec{a} = (a_x, a_y, a_z)</math> and <math>\vec{b} = (b_x, b_y, b_z)</math> in <math>\mathbf{R}^3</math>:


===Dot Product (also called Scalar Product)===
<math>\vec{a} \cdot \vec{b} = \langle \vec{a}, \vec{b} \rangle = a_x b_x + a_y b_y + a_z b_z</math>


For <math>\vec{a} = \langle a_x, a_y, a_z \rangle</math> and <math>\vec{b} = \langle b_x, b_y, b_z \rangle</math>, the dot product is
Unlike scalar multiplication, the dot product takes two vectors and outputs a '''scalar'''. For nonzero vectors separated by angle <math>\theta \in [0, \pi]</math>, it satisfies:


<math>\vec{a}\cdot\vec{b} = a_x b_x + a_y b_y + a_z b_z.</math>
<math>\vec{a} \cdot \vec{b} = \|\vec{a}\|\|\vec{b}\|\cos\theta</math>


The result is a scalar. The dot product measures how much two vectors “line up” with each other. A key property is
Geometrically, <math>\vec{a} \cdot \hat{b} = \|\vec{a}\|\cos\theta</math> gives the signed projection of <math>\vec{a}</math> onto the direction of <math>\vec{b}</math>—which is why mechanical work by a constant force is written <math>W = \vec{F} \cdot \Delta\vec{r}</math>. While the zero vector is formally orthogonal to every vector (<math>\vec{0} \cdot \vec{v} = 0</math>), two '''nonzero''' vectors are perpendicular (<math>\theta = \frac{\pi}{2}</math>) if and only if <math>\vec{a} \cdot \vec{b} = 0</math>.
 
<math>\vec{a}\cdot\vec{b} = |\vec{a}|\;|\vec{b}|\cos(\theta),</math>
 
where <math>\theta</math> is the angle between <math>\vec{a}</math> and <math>\vec{b}</math>. If the dot product is zero, the vectors are perpendicular.


[[File:IMG_0328.jpg|400px|Image: 400 pixels]]
[[File:IMG_0328.jpg|400px|Image: 400 pixels]]


===Cross Product (also called Vector Product)===
===Cross Product===


One component-based definition of the cross product (the one often found on formula sheets) is:
In <math>\mathbf{R}^3</math>, the '''cross product''' (or '''vector product''') of <math>\vec{a} = (a_x, a_y, a_z)</math> and <math>\vec{b} = (b_x, b_y, b_z)</math> is a new vector defined in components by:


<math>\vec{a} \times \vec{b} = \langle a_yb_z - a_zb_y,\; a_zb_x - a_xb_z,\; a_xb_y - a_yb_x \rangle.</math>
<math>\vec{a} \times \vec{b} = (a_y b_z - a_z b_y,\; a_z b_x - a_x b_z,\; a_x b_y - a_y b_x)</math>


You may also see it written as
Written in the standard orthonormal basis <math>\hat{i}, \hat{j}, \hat{k}</math>, this is equivalently:


<math>\vec{a} \times \vec{b} = (a_yb_z - a_zb_y)\hat{i} - (a_zb_x - a_xb_z)\hat{j} + (a_xb_y - a_yb_x)\hat{k}.</math>
<math>\vec{a} \times \vec{b} = (a_y b_z - a_z b_y)\hat{i} - (a_x b_z - a_z b_x)\hat{j} + (a_x b_y - a_y b_x)\hat{k}</math>


Although this looks complicated, the key idea is that the cross product of two 3D vectors is a new vector that is orthogonal to both of them. The order matters: changing the order flips the sign.
The cross product is bilinear (linear in each argument separately) and '''anticommutative'''—swapping the order reverses the sign: <math>\vec{b} \times \vec{a} = -(\vec{a} \times \vec{b})</math>. In particular, <math>\vec{a} \times \vec{a} = \vec{0}</math> for every vector <math>\vec{a}</math>.


A common way to remember the formula is through the determinant of a 3×3 matrix:
A standard mnemonic for computing <math>\vec{a} \times \vec{b}</math> is the formal determinant of a <math>3 \times 3</math> symbolic matrix, expanded along the first row (observing the alternating <math>+, -, +</math> signs of cofactor expansion):


<math>\begin{vmatrix}
<math>\vec{a} \times \vec{b} = \begin{vmatrix}
\hat{i} & \hat{j} & \hat{k} \\
\hat{i} & \hat{j} & \hat{k} \\
a_x & a_y & a_z \\
a_x & a_y & a_z \\
b_x & b_y & b_z
b_x & b_y & b_z
\end{vmatrix}.</math>
\end{vmatrix} = \begin{vmatrix} a_y & a_z \\ b_y & b_z \end{vmatrix}\hat{i} - \begin{vmatrix} a_x & a_z \\ b_x & b_z \end{vmatrix}\hat{j} + \begin{vmatrix} a_x & a_y \\ b_x & b_y \end{vmatrix}\hat{k}</math>


You can expand this determinant using cofactor expansion. Remember that the <math>\hat{j}</math> term has a minus sign.
[[File:Expansionbyminors.png|400px]]
 
Online resources for checking computations:
* [https://www.symbolab.com/solver/vector-cross-product-calculator Symbolab step-by-step cross product calculator]
* [https://www.youtube.com/watch?v=e9T5p_Jwv5c Video explanation of the cross product]
 
Geometrically, the norm of the cross product equals the '''area of the parallelogram''' spanned by <math>\vec{a}</math> and <math>\vec{b}</math>:
 
<math>\|\vec{a} \times \vec{b}\| = \|\vec{a}\|\|\vec{b}\|\sin\theta</math>


[[File:Expansionbyminors.png|400px]]
where <math>\theta \in [0, \pi]</math> is the angle between <math>\vec{a}</math> and <math>\vec{b}</math>. Its direction is orthogonal to both <math>\vec{a}</math> and <math>\vec{b}</math> and is uniquely determined by the [[Right Hand Rule]]. In introductory physics, the cross product governs rotational and electromagnetic phenomena such as torque (<math>\vec{\tau} = \vec{r} \times \vec{F}</math>), angular momentum (<math>\vec{L} = \vec{r} \times \vec{p}</math>), and the magnetic Lorentz force (<math>\vec{F}_B = q(\vec{v} \times \vec{B})</math>).
 
====Component Pattern ("X-Method")====
 
A fast computational pattern avoids writing out the full <math>3 \times 3</math> determinant. Consider:
 
<math>\vec{a} = (3, -2, 4), \qquad \vec{b} = (-1, 6, 3)</math>


You can also use online tools or videos to check your work:
To compute <math>\vec{c} = \vec{a} \times \vec{b} = (c_x, c_y, c_z)</math>, list each vector's components vertically and append the first component at the bottom:


* Cross product step-by-step calculator: [https://www.symbolab.com/solver/vector-cross-product-calculator  https://www.symbolab.com/solver/vector-cross-product-calculator] 
<math>\begin{pmatrix} a_x \\ a_y \\ a_z \\ a_x \end{pmatrix} = \begin{pmatrix} 3 \\ -2 \\ 4 \\ 3 \end{pmatrix}, \qquad \begin{pmatrix} b_x \\ b_y \\ b_z \\ b_x \end{pmatrix} = \begin{pmatrix} -1 \\ 6 \\ 3 \\ -1 \end{pmatrix}</math>
* Video explanation: [https://www.youtube.com/watch?v=e9T5p_Jwv5c https://www.youtube.com/watch?v=e9T5p_Jwv5c]


The magnitude of the cross product satisfies
* For <math>c_x</math>, cross-multiply rows 2 and 3 (<math>a_y b_z - a_z b_y</math>):


<math>|\vec{a}\times\vec{b}| = |\vec{a}|\;|\vec{b}|\sin(\theta)</math>,
[[File:Cx.png]]


where <math>\theta</math> is the angle between <math>\vec{a}</math> and <math>\vec{b}</math>. Its direction is perpendicular to the plane of <math>\vec{a}</math> and <math>\vec{b}</math> and is chosen using the [[Right Hand Rule]]. In 2D, the usual cross product is not defined.
:<math>c_x = (-2)(3) - (4)(6) = -6 - 24 = -30</math>


<b>For more mathematically-advanced students</b>, we can connect this to linear algebra. Let <math>A \in \mathbb{R}^{m \times n}</math> be a matrix, and consider its **null space**:
* For <math>c_y</math>, cross-multiply rows 3 and 4 (<math>a_z b_x - a_x b_z</math>):


<math>\operatorname{Null}(A) = \{ \vec{v} \in \mathbb{R}^n \mid A\vec{v} = \vec{0} \}.</math>
[[File:Cy.png]]


The null space is the set of all vectors that are orthogonal to every row of <math>A</math>. Writing the rows as <math>\vec{a}_1,\ldots,\vec{a}_m</math>, the equation <math>A\vec{v}=\vec{0}</math> expands to
:<math>c_y = (4)(-1) - (3)(3) = -4 - 9 = -13</math>


<math>\begin{bmatrix}\vec{a}_1 \\ \vec{a}_2 \\ \vdots \\ \vec{a}_m\end{bmatrix}\vec{v} = \begin{bmatrix}\vec{a}_1 \cdot \vec{v} \\ \vec{a}_2 \cdot \vec{v} \\ \vdots \\ \vec{a}_m \cdot \vec{v}\end{bmatrix} = \begin{bmatrix}0 \\ 0 \\ \vdots \\ 0\end{bmatrix}.</math>
* For <math>c_z</math>, cross-multiply rows 1 and 2 (<math>a_x b_y - a_y b_x</math>):


So every vector in the null space is perpendicular to each row, and therefore to the whole row space.
[[File:Cz.png]]


For two vectors <math>\vec{a}, \vec{b} \in \mathbb{R}^3</math> that are not multiples of each other, think of them as the rows of a 2×3 matrix <math>A</math>. The null space of <math>A</math> consists of all vectors orthogonal to both <math>\vec{a}</math> and <math>\vec{b}</math>. The cross product <math>\vec{a}\times\vec{b}</math> is (up to scaling and orientation) the unique nonzero vector in this null space once we fix the magnitude and choose a direction using the right-hand rule. This is another way to see why the cross product is perpendicular to both original vectors. In higher dimensions, the null space can have more than one dimension, so there isn’t a single unique “cross product direction” in the same way.
:<math>c_z = (3)(6) - (-2)(-1) = 18 - 2 = 16</math>


====Another Cross Product Trick====
Thus <math>\vec{a} \times \vec{b} = (-30, -13, 16)</math>. As a quick sanity check, verify orthogonality via the dot product: <math>\vec{a} \cdot \vec{c} = 3(-30) + (-2)(-13) + 4(16) = 0</math>.


Here is a pattern-based way to compute the cross product quickly, using components.


Suppose
====Advanced Note: What the Cross Product Really Measures (and Why 3D Is Special)====


<math>\vec{a} = \langle 3, -2, 4 \rangle, \quad \vec{b} = \langle -1, 6, 3 \rangle.</math>
<div class="mw-collapsible mw-collapsed" data-expandtext="Show Advanced Note" data-collapsetext="Hide Advanced Note" style="border:1px solid #a2a9b1; padding:8px; background:#f8f9fa;">
'''Optional Reading (Geometric and Linear Algebra Interpretation)'''
<div class="mw-collapsible-content">


We want <math>\vec{c} = \vec{a} \times \vec{b} = \langle c_x, c_y, c_z \rangle.</math>
At first glance, the component formula for <math>\vec{a} \times \vec{b}</math> seems arbitrary, and it is unclear where the <math>3 \times 3</math> determinant comes from. Two viewpoints make both completely transparent and explain what happens outside 3D.


Arrange the components vertically and repeat the first component at the bottom:
'''1. Components as Signed Shadow Areas'''


<math>\begin{vmatrix}
Look at the three components of <math>\vec{c} = \vec{a} \times \vec{b}</math>:
a_x \\
a_y \\
a_z \\
a_x
\end{vmatrix}
=
\begin{vmatrix}
3 \\
-2 \\
4 \\
3
\end{vmatrix}</math>,
<math>\begin{vmatrix}
b_x \\
b_y \\
b_z \\
b_x
\end{vmatrix}
=
\begin{vmatrix}
-1 \\
6 \\
3 \\
-1
\end{vmatrix}</math>.


To find <math>c_x</math>, draw an “X” connecting <math>a_y</math> with <math>b_z</math> and <math>a_z</math> with <math>b_y</math>:
<math>c_x = a_y b_z - a_z b_y, \qquad c_y = a_z b_x - a_x b_z, \qquad c_z = a_x b_y - a_y b_x</math>


[[File:Cx.png]]
In 2D, the expression <math>a_x b_y - a_y b_x</math> is the '''signed area''' of the parallelogram spanned by <math>(a_x, a_y)</math> and <math>(b_x, b_y)</math> (positive if rotating from <math>\vec{a}</math> to <math>\vec{b}</math> is counterclockwise, negative if clockwise). Therefore, the three components of <math>\vec{a} \times \vec{b}</math> can be seen as the signed areas of the '''shadows''' cast by the 3D parallelogram onto the three coordinate planes:
* <math>c_x</math> is the signed area of the shadow on the <math>yz</math>-plane (perpendicular to the <math>x</math>-axis).
* <math>c_y</math> is the signed area of the shadow on the <math>zx</math>-plane (perpendicular to the <math>y</math>-axis).
* <math>c_z</math> is the signed area of the shadow on the <math>xy</math>-plane (perpendicular to the <math>z</math>-axis).


Then compute
Then the formula <math>\|\vec{a} \times \vec{b}\| = \sqrt{c_x^2 + c_y^2 + c_z^2}</math> is a 3D Pythagorean theorem for areas: the squared area of any tilted parallelogram equals the sum of the squared areas of its three coordinate-plane shadows.


<math>c_x = a_y b_z - a_z b_y = (-2)(3) - (4)(6) = -6 - 24 = -30.</math>
'''2. The Determinant Formula as Signed Volume'''


For <math>c_y</math>, use <math>a_z</math> with the bottom <math>b_x</math> and the bottom <math>a_x</math> with <math>b_z</math>:
Fix two vectors <math>\vec{a}, \vec{b} \in \mathbf{R}^3</math>. For any third vector <math>\vec{v} = (v_x, v_y, v_z) \in \mathbf{R}^3</math>, the <math>3 \times 3</math> determinant


[[File:Cy.png]]
<math>V(\vec{v}) = \det\begin{pmatrix} v_x & v_y & v_z \\ a_x & a_y & a_z \\ b_x & b_y & b_z \end{pmatrix}</math>


So
gives the '''signed volume''' of the parallelepiped spanned by <math>\vec{a}</math>, <math>\vec{b}</math>, and <math>\vec{v}</math>. Expanding along the first row shows that <math>V(\vec{v})</math> is simply a linear combination of <math>v_x, v_y, v_z</math>:


<math>c_y = a_z b_x - a_x b_z = (4)(-1) - (3)(3) = -4 - 9 = -13.</math>
<math>V(\vec{v}) = (a_y b_z - a_z b_y)v_x + (a_z b_x - a_x b_z)v_y + (a_x b_y - a_y b_x)v_z = \langle \vec{c}, \vec{v} \rangle</math>


For <math>c_z</math>, connect <math>a_x</math> with <math>b_y</math> and <math>a_y</math> with <math>b_x</math>:
In linear algebra, the cross product <math>\vec{c} = \vec{a} \times \vec{b}</math> is '''defined''' as the unique vector whose inner product with any <math>\vec{v}</math> computes this signed volume: <math>\langle \vec{a} \times \vec{b}, \vec{v} \rangle = V(\vec{v})</math>. This single equation explains every property of the cross product at once:
* '''Why the determinant works:''' Replacing <math>(v_x, v_y, v_z)</math> with <math>(\hat{i}, \hat{j}, \hat{k})</math> is just a compact way of collecting the coefficients of <math>v_x, v_y, v_z</math> into the vector <math>\vec{c}</math>.
* '''Orthogonality:''' Setting <math>\vec{v} = \vec{a}</math> or <math>\vec{v} = \vec{b}</math> flattens the parallelepiped to volume <math>0</math>, so <math>\langle \vec{a} \times \vec{b}, \vec{a} \rangle = 0</math> and <math>\langle \vec{a} \times \vec{b}, \vec{b} \rangle = 0</math>.
* '''Magnitude = Base Area:''' Setting <math>\vec{v} = \hat{n}</math> (the unit vector pointing in the direction of <math>\vec{a} \times \vec{b}</math>) builds a parallelepiped of height <math>1</math> over the base spanned by <math>\vec{a}</math> and <math>\vec{b}</math>. Its volume equals <math>(\text{base area}) \times 1</math>, while <math>\langle \vec{a} \times \vec{b}, \hat{n} \rangle = \|\vec{a} \times \vec{b}\|</math>.
* '''Right-hand rule:''' Setting <math>\vec{v} = \vec{a} \times \vec{b}</math> gives volume <math>\|\vec{a} \times \vec{b}\|^2 > 0</math> (for non-parallel <math>\vec{a}, \vec{b}</math>), forcing <math>(\vec{a}, \vec{b}, \vec{a} \times \vec{b})</math> to have positive (right-handed) orientation.


[[File:Cz.png]]
'''3. Why Two-Vector Cross Products Are Special to 3D (and the 7D Exception)'''


Then
Suppose you have two non-parallel vectors <math>a, b \in \mathbf{R}^n</math> and want a vector <math>v \in \mathbf{R}^n</math> orthogonal to both. That means solving two linear equations—<math>\langle a, v \rangle = 0</math> and <math>\langle b, v \rangle = 0</math>—in <math>n</math> unknowns, leaving <math>n - 2</math> free parameters:
* In <math>\mathbf{R}^2</math> (<math>n = 2</math>): <math>2 - 2 = 0</math> free parameters. Only the zero vector is orthogonal to both <math>a</math> and <math>b</math>.
* In <math>\mathbf{R}^3</math> (<math>n = 3</math>): <math>3 - 2 = 1</math> free parameter. All orthogonal vectors lie along a '''single line''', so specifying magnitude and the right-hand rule picks out a unique vector.
* In <math>\mathbf{R}^4</math> (<math>n = 4</math>): <math>4 - 2 = 2</math> free parameters—an entire 2D plane of orthogonal vectors. For example, both <math>(0, 0, 1, 0)</math> and <math>(0, 0, 0, 1)</math> (and every linear combination of them) are perpendicular to <math>(1, 0, 0, 0)</math> and <math>(0, 1, 0, 0)</math>, so "perpendicular to both" no longer specifies a single direction.


<math>c_z = a_x b_y - a_y b_x = (3)(6) - (-2)(-1) = 18 - 2 = 16.</math>
Physics uses the cross product to describe '''rotations and oriented planes''' (such as the plane of a spinning wheel or a current loop). Every rotation takes place ''in a 2D plane'', not inherently ''around a line'':
* In 2D, there is only <math>\binom{2}{2} = 1</math> coordinate plane (<math>xy</math>), so rotation is just a single signed scalar (clockwise or counterclockwise).
* In 3D, there are <math>\binom{3}{2} = 3</math> coordinate planes (<math>yz, zx, xy</math>)—which happens to equal the <math>3</math> coordinate axes (<math>x, y, z</math>). This coincidence lets us pair each plane of rotation with its unique normal axis and package torque, angular momentum, and magnetic fields as 3D vectors.
* In 4D, there are <math>\binom{4}{2} = 6</math> independent coordinate planes (<math>xy, xz, xw, yz, yw, zw</math>), which cannot be stored in a 4-component vector. That is why in 4D relativity, angular momentum and the electromagnetic field are represented as <math>4 \times 4</math> antisymmetric matrices (which have <math>6</math> independent entries—one per coordinate plane) rather than 4-vectors.


Thus
The signed-volume construction <math>\langle c, v \rangle = \det(v, v_1, \dots, v_{n-1})</math> generalizes cleanly to any dimension <math>n</math> if you supply <math>n - 1</math> vectors instead of <math>2</math> (leaving <math>n - (n - 1) = 1</math> perpendicular axis). In 2D, it takes <math>1</math> vector <math>(a_x, a_y)</math> and returns <math>(-a_y, a_x)</math> (a <math>90^\circ</math> counterclockwise rotation); in 3D, it takes <math>2</math> vectors (the standard cross product); in 4D, it takes <math>3</math> vectors to determine a single perpendicular vector.


<math>\vec{a}\times\vec{b} = \langle -30, -13, 16 \rangle.</math>
Finally, what if we relax the requirement that orthogonality alone determine a unique line, and simply ask for ''any'' bilinear product of two vectors in <math>\mathbf{R}^n</math> (<math>n \ge 2</math>) that is orthogonal to both inputs and has norm equal to the parallelogram area (<math>\|a \times b\|^2 = \|a\|^2\|b\|^2 - \langle a, b \rangle^2</math>)? Remarkably, such a cross product exists '''only in <math>n = 3</math> and <math>n = 7</math>'''. In <math>\mathbf{R}^7</math>, the space orthogonal to two non-parallel vectors is <math>7 - 2 = 5</math>-dimensional, so orthogonality does not select a direction; instead, a 7D cross product picks out a specific perpendicular vector using the multiplication table of the 8-dimensional '''octonions''' (just as the 3D cross product comes from the 4-dimensional '''quaternions'''). Because that choice depends on the octonion multiplication rule, the 7D cross product is not unique up to sign, is not preserved by all 7D rotations, and loses the general vector triple product identity (since octonion multiplication is non-associative).


With practice, you may not need to draw the X each time and can compute the components directly from the pattern.
</div>
</div>


==Equations Involving Vector Operations==
===Vector Product Identities===


You may sometimes encounter equations that mix dot products and cross products. Two useful facts:
When combining dot products and cross products in <math>\mathbf{R}^3</math>, two identities are particularly useful:


<ol>
# '''Orthogonality:''' <math>(\vec{w} \times \vec{v}) \cdot \vec{v} = 0</math> and <math>(\vec{w} \times \vec{v}) \cdot \vec{w} = 0</math>. Because <math>\vec{w} \times \vec{v}</math> is orthogonal to both <math>\vec{w}</math> and <math>\vec{v}</math>, its dot product with either vanishes.
<li><math>(\vec{w} \times \vec{v}) \cdot \vec{v} = 0</math>, because <math>\vec{w} \times \vec{v}</math> is perpendicular to both <math>\vec{w}</math> and <math>\vec{v}</math>, so its dot product with either original vector is zero.</li>
# '''Scalar Triple Product:''' <math>\vec{a} \cdot (\vec{b} \times \vec{c}) = (\vec{a} \times \vec{b}) \cdot \vec{c} = \vec{b} \cdot (\vec{c} \times \vec{a})</math>. This scalar equals the determinant of the <math>3 \times 3</math> matrix whose rows (or columns) are <math>\vec{a}, \vec{b}, \vec{c}</math>, and its absolute value equals the '''volume of the parallelepiped''' spanned by the vectors. Cyclic permutations of these vectors preserve the volume and swapping any two vectors flips the sign.
<li><math>\vec{a} \cdot (\vec{b} \times \vec{c}) = (\vec{a} \times \vec{b}) \cdot \vec{c}</math>. This identity, called the scalar triple product identity, can be useful if one cross product is easier to compute than the other. Note that the cross product part is still order-sensitive, while the dot product is commutative.</li>
</ol>


==Forms==
==Representations of a Vector==


There are several common ways to describe a vector, all containing the same information.
A physical vector or an element of an abstract vector space <math>V</math> exists independently of any coordinate system. Once an ordered basis is chosen, it establishes a one-to-one correspondence (isomorphism <math>V \cong \mathbf{R}^n</math>) that assigns each vector a unique list of coordinates. Depending on the problem, we choose whichever representation is most convenient; all carry identical information.


===Magnitude and Direction Form===
===Magnitude and Direction Form===


In this form, we specify:
In this form, we specify:
* The norm (magnitude) <math>\|\vec{a}\|</math>, and
* The orientation (an angle, cardinal direction, or axis).


* The magnitude (length), and 
For example, "a <math>5\ \text{m}</math> displacement at <math>36.9^\circ</math> above the horizontal" is in this form. This form is intuitive and often used in word problems and real-life descriptions.
* A description of the direction (cardinal direction, angle, or axis).
 
For example, “a 5 m vector at 60° above the horizontal” is in magnitude and direction form. This form is intuitive and often used in word problems and real-life descriptions.


===Component Form===
===Component Form===


Here, we break the vector into components along the coordinate axes. In 3D, a vector is written as
Once a basis is decided, we break the vector into components along the coordinate axes. In <math>\mathbf{R}^3</math>:


<math>\langle a_x, a_y, a_z \rangle.</math>
<math>\vec{a} = (a_x, a_y, a_z)</math>


For example, <math>\langle 2, 0, -3 \rangle</math> means the vector extends 2 units in +x, 0 units in y, and 3 units in -z. Most algebraic operations (like dot and cross products) are done using component form. Programming languages also typically store vectors in this way.
For example, <math>(4, 3, 0)</math> means the vector extends 2 units along <math>+x</math>, 0 along <math>y</math>, and 3 along <math>-z</math>. Most algebraic operations are done using component form. Computers also typically store vectors this way (at least in the abstract sense).


===Unit Vector Form===
===Unit Vector Form===


In unit vector form, we write a vector as a combination of unit vectors:
Using the standard orthonormal basis <math>\hat{i}, \hat{j}, \hat{k}</math> (or alternatively written as <math>\hat{x}, \hat{y}, \hat{z}</math>) of <math>\mathbf{R}^3</math>, every vector is written uniquely as a linear combination:
 
<math>\hat{i}</math>, <math>\hat{j}</math>, <math>\hat{k}</math> or <math>\hat{x}</math>, <math>\hat{y}</math>, <math>\hat{z}</math>.


For instance, the vector <math>\langle 2, 0, -3 \rangle</math> can be written as
<math>\vec{a} = a_x \hat{i} + a_y \hat{j} + a_z \hat{k}</math>


<math>2\hat{i} - 3\hat{k}.</math>
For example, <math>(4, 3, 0) = 4\hat{i} + 3\hat{j}</math>. Unit vector form and component form carry identical numerical information; basis form makes the underlying linear combination explicit, which can be useful when working in other bases.
 
Unit vector form and component form contain the same numerical information; they just use different notation.


[[File:Vectorsdifferentforms.png]]
[[File:Vectorsdifferentforms.png]]


In n dimensions, a vector always needs n numbers to describe it fully. In 3D, magnitude–direction form uses 1 number for magnitude and 2 angles for direction, while component or unit-vector form uses 3 components.
In <math>n</math> dimensions, specifying a vector always requires <math>n</math> numbers in the field (which in introductory physics is almost always the real numbers), regardless of the representation. In <math>\mathbf{R}^3</math>, Cartesian component form uses <math>3</math> coordinates <math>(a_x, a_y, a_z)</math>, while spherical magnitude–direction form uses <math>1</math> norm and <math>2</math> angles <math>(\|\vec{a}\|, \theta, \phi)</math>.


===Converting Between Forms===
===Converting Between Forms===


We can move between forms using trigonometry and the Pythagorean theorem.
In <math>\mathbf{R}^2</math>, we convert between Cartesian components <math>(a_x, a_y)</math> and polar magnitude–direction form <math>(\|\vec{a}\|, \phi)</math> with <math>\phi \in (-\pi, \pi]</math> using the inner product and right-triangle trigonometry:
 
* For a 2D vector <math>\vec{a} = \langle a_x, a_y \rangle</math>, the magnitude is
  <math>|\vec{a}| = \sqrt{a_x^2 + a_y^2}.</math>
 
* The direction angle from the positive x-axis is
  <math>\theta = \tan^{-1}\left(\frac{a_y}{a_x}\right)</math> (with quadrant checks).


* Given magnitude <math>|\vec{a}|</math> and angle <math>\theta</math>, the components are
* '''Components to magnitude and direction:'''
  <math>a_x = |\vec{a}|\cos\theta</math>,
:<math>\|\vec{a}\| = \sqrt{\langle \vec{a}, \vec{a} \rangle} = \sqrt{a_x^2 + a_y^2}</math>
  <math>a_y = |\vec{a}|\sin\theta</math>.
:<math>\phi = \begin{cases} \arctan\!\left(\frac{a_y}{a_x}\right) & \text{if } a_x > 0, \\ \arctan\!\left(\frac{a_y}{a_x}\right) + \pi & \text{if } a_x < 0 \text{ and } a_y \ge 0, \\ \arctan\!\left(\frac{a_y}{a_x}\right) - \pi & \text{if } a_x < 0 \text{ and } a_y < 0, \\ \frac{\pi}{2} & \text{if } a_x = 0 \text{ and } a_y > 0, \\ -\frac{\pi}{2} & \text{if } a_x = 0 \text{ and } a_y < 0. \end{cases}</math>
:(For <math>\vec{a} = (0, 0)</math>, <math>\phi</math> is undefined. This piecewise formula is equivalent to the two-argument function <math>\operatorname{atan2}(a_y, a_x)</math> used in computing; to express <math>\phi</math> in <math>[0, 2\pi)</math> instead, add <math>2\pi</math> whenever <math>\phi < 0</math>.)
* '''Magnitude and direction to components''' (via inner product projections onto the orthonormal basis <math>\hat{x}, \hat{y}</math>):
:<math>a_x = \langle \vec{a}, \hat{x} \rangle = \|\vec{a}\|\cos\phi</math>
:<math>a_y = \langle \vec{a}, \hat{y} \rangle = \|\vec{a}\|\sin\phi</math>


==Vectors in VPython==
==Vectors in VPython==


In VPython (used in GlowScript), vectors are represented by the type <code>vec</code> or <code>vector</code>. The constructor takes three arguments: the x, y, and z components.
In VPython (used in GlowScript), vectors are represented by the type <code>vec</code> or <code>vector</code>. The constructor takes three arguments: the x, y, and z components:


Example:
<pre>
 
velocity = vec(3, -1, 2)
<code>velocity = vec(3, -1, 2)</code>
</pre>


This creates a vector called <code>velocity</code> with components (3, -1, 2).
This creates a vector called <code>velocity</code> with coordinates <math>(3, -1, 2)</math>. (Note that when printed to the console, VPython displays vectors using angle brackets, e.g., <code>&lt;3, -1, 2&gt;</code>, following introductory physics convention rather than inner-product notation.)


In VPython’s default view, +x points to the right, +y points upward, and +z points out of the screen toward the viewer.
In VPython's default view, <math>+x</math> points right, <math>+y</math> points upward, and <math>+z</math> points out of the screen toward the viewer.


===Modifying Vectors===
===Modifying Vectors===


You can access or modify individual components using <code>.x</code>, <code>.y</code>, and <code>.z</code>. For example:
Individual components can be accessed or updated with <code>.x</code>, <code>.y</code>, and <code>.z</code>:


<code>velocity.x = 5</code>
<pre>
 
velocity.x = 5 # changes velocity from (3, -1, 2) to (5, -1, 2)
changes the x-component from 3 to 5.
</pre>


===Helpful Vector Functions===
===Helpful Vector Functions===
Line 468: Line 424:
====Magnitude====
====Magnitude====


VPython provides the <code>mag</code> function to compute the magnitude of a vector:
VPython provides the <code>mag</code> function to compute the magnitude (Euclidean norm) of a vector:


<code>
<pre>
velocity = vec(3, -1, 2)
velocity = vec(3, -1, 2)
speed = mag(velocity)  # magnitude of velocity
speed = mag(velocity)  # magnitude of velocity
</code>
</pre>


====Normalize====
====Normalize====
Line 479: Line 435:
To obtain a unit vector in the same direction (normalize a vector), use <code>norm</code>:
To obtain a unit vector in the same direction (normalize a vector), use <code>norm</code>:


<code>
<pre>
v = vec(5, 0, 0)
v = vec(5, 0, 0)
v_hat = norm(v)  # v_hat = <1, 0, 0>
v_hat = norm(v)  # unit vector (1, 0, 0)
</code>
</pre>
 


====Dot and Cross Product====
====Dot and Cross Product====
Line 488: Line 445:
The functions <code>dot</code> and <code>cross</code> compute dot and cross products:
The functions <code>dot</code> and <code>cross</code> compute dot and cross products:


<code>
<pre>
a = vec(1, 2, 3)
a = vec(1, 2, 3)
b = vec(4, 5, 6)
b = vec(4, 5, 6)
dot_prod = dot(a, b)      # a · b
dot_prod = dot(a, b)      # <a, b> = a · b
cross_prod = cross(a, b)  # a × b
cross_prod = cross(a, b)  # a × b
</code>
</pre>


===Visualization===
===Visualization===


To visualize vectors, VPython provides the <code>arrow</code> object. You specify:
To visualize vectors, VPython provides the <code>arrow</code> object, specified by:
 
* <code>pos</code> – tail position,
* <code>pos</code> – tail position,
* <code>axis</code> – direction and length of the arrow (a vector).
* <code>axis</code> – direction and length of the arrow (a vector).


Optional parameters include <code>shaftwidth</code>, <code>headwidth</code>, and <code>headlength</code>. You can also change attributes like <code>color</code>. See more details [https://www.glowscript.org/docs/VPythonDocs/arrow.html here].
Optional attributes include <code>shaftwidth</code>, <code>headwidth</code>, <code>headlength</code>, and <code>color</code> (see the [https://www.glowscript.org/docs/VPythonDocs/arrow.html VPython arrow documentation]).


Example of a velocity vector arrow at the origin:
<pre>
 
<code>
velocity = vec(1, 1, 0)
velocity = vec(1, 1, 0)
origin = vec(0, 0, 0)
origin = vec(0, 0, 0)
Line 512: Line 466:
vel_arrow = arrow(pos=origin, axis=velocity,
vel_arrow = arrow(pos=origin, axis=velocity,
                   shaftwidth=shaftwidth, color=color.red)
                   shaftwidth=shaftwidth, color=color.red)
</code>
</pre>


[[File:Arrow_viz.png]]
[[File:Arrow_viz.png]]
''Output in VPython of Visualized Vector''
''Output in VPython of a visualized vector''


==A Computational Model==
===A Computational Model===


[https://trinket.io/glowscript/3d7c75ed91 Click here to run the interactive computational model.]
[https://trinket.io/glowscript/3d7c75ed91 Click here to run the interactive GlowScript computational model.]


This model walks through basic vector operations step by step. It starts by defining vectors as arrows, then explores:
This model walks through basic vector operations step by step. It starts by defining vectors as arrows, then explores:
Line 530: Line 484:
Each operation is shown both in formula form and using VPython shortcut functions. You can edit the vector values and rerun the code to see how the results change. Commenting out parts of the script can help you focus on one type of operation at a time.
Each operation is shown both in formula form and using VPython shortcut functions. You can edit the vector values and rerun the code to see how the results change. Commenting out parts of the script can help you focus on one type of operation at a time.


==Examples==
==Exercises and Solutions==


===Very Simple===
===Very Simple===


Vector <math>\vec{a} = \langle 2.5, 7.4, 8.0 \rangle</math>. Find its magnitude and a unit vector in its direction.
Given the vector <math>\vec{a} = (2.5, 7.4, 8.0)</math>, find its norm (magnitude) and a unit vector in its direction.
 
<div class="mw-collapsible mw-collapsed" data-expandtext="Show Solution" data-collapsetext="Hide Solution" style="border:1px solid #a2a9b1; padding:8px; background:#f8f9fa;">
'''Solution'''
<div class="mw-collapsible-content">
 
First, compute the Euclidean norm:
 
<math>\|\vec{a}\| = \sqrt{2.5^2 + 7.4^2 + 8.0^2} = \sqrt{6.25 + 54.76 + 64} = \sqrt{125.01} \approx 11.18.</math>
 
<math>\hat{a} = \frac{1}{\|\vec{a}\|}\vec{a} = \left(\frac{2.5}{\sqrt{125.01}},\; \frac{7.4}{\sqrt{125.01}},\; \frac{8.0}{\sqrt{125.01}}\right) \approx (0.224,\; 0.662,\; 0.716).</math>
 
Then the norm is about <math>11.18</math>, and the unit vector in its direction is <math>(0.224, 0.662, 0.716)</math>.
 
</div>
</div>


**Solution:**
===Simple===


First, find the magnitude:
Let <math>\vec{a} = (2, 4, 2)</math> and <math>\vec{b} = (-1, 1, 3)</math>. Find the norm of <math>\vec{a} - 2\vec{b}</math>.


<math>|\vec{a}| = \sqrt{2.5^2 + 7.4^2 + 8.0^2}</math>
<div class="mw-collapsible mw-collapsed" data-expandtext="Show Solution" data-collapsetext="Hide Solution" style="border:1px solid #a2a9b1; padding:8px; background:#f8f9fa;">
'''Solution'''
<div class="mw-collapsible-content">


<math>= \sqrt{6.25 + 54.76 + 64}</math>
Compute the combination coordinate-wise:


<math>= \sqrt{125.01} \approx 11.18.</math>
<math>\vec{a} - 2\vec{b} = (2, 4, 2) - 2(-1, 1, 3) = (2, 4, 2) - (-2, 2, 6) = (4, 2, -4).</math>


Now form the unit vector:
Now find its norm:


<math>\hat{a} = \frac{\vec{a}}{|\vec{a}|} = \left\langle \frac{2.5}{11.18}, \frac{7.4}{11.18}, \frac{8.0}{11.18} \right\rangle \approx \langle 0.224, 0.662, 0.716 \rangle.</math>
<math>\|(4, 2, -4)\| = \sqrt{4^2 + 2^2 + (-4)^2} = \sqrt{16 + 4 + 16} = \sqrt{36} = 6.</math>


So the magnitude is about 11.18, and the direction can be described by the unit vector <math>\langle 0.224, 0.662, 0.716 \rangle</math>.
</div>
</div>


===Simple===
===Simple===


Let <math>\vec{a} = \langle 2, 4, 2 \rangle</math> and <math>\vec{b} = \langle -1, 1, 3 \rangle</math>. Find the magnitude of <math>\vec{a} - 2\vec{b}</math>.
Find the angle <math>\theta \in [0, \pi]</math> between <math>\vec{a} = (2, 5, -2)</math> and <math>\vec{b} = (3, -4, -1)</math>.
 
<div class="mw-collapsible mw-collapsed" data-expandtext="Show Solution" data-collapsetext="Hide Solution" style="border:1px solid #a2a9b1; padding:8px; background:#f8f9fa;">
'''Solution'''
<div class="mw-collapsible-content">
 
From the inner product angle formula:


**Solution:**
<math>\langle \vec{a}, \vec{b} \rangle = \|\vec{a}\|\|\vec{b}\|\cos\theta \implies \theta = \arccos\!\left(\frac{\langle \vec{a}, \vec{b} \rangle}{\|\vec{a}\|\|\vec{b}\|}\right).</math>


Compute the combination:
Compute the inner product:


<math>\vec{a} - 2\vec{b} = \langle 2, 4, 2 \rangle - 2\langle -1, 1, 3 \rangle</math>
<math>\langle \vec{a}, \vec{b} \rangle = 2(3) + 5(-4) + (-2)(-1) = 6 - 20 + 2 = -12.</math>


<math>= \langle 2, 4, 2 \rangle - \langle -2, 2, 6 \rangle</math>
Compute the norms:


<math>= \langle 4, 2, -4 \rangle.</math>
<math>\|\vec{a}\| = \sqrt{2^2 + 5^2 + (-2)^2} = \sqrt{4 + 25 + 4} = \sqrt{33},</math>


Now find the magnitude:
<math>\|\vec{b}\| = \sqrt{3^2 + (-4)^2 + (-1)^2} = \sqrt{9 + 16 + 1} = \sqrt{26}.</math>
 
Finally,
 
<math>\theta = \arccos\!\left(\frac{-12}{\sqrt{33}\sqrt{26}}\right) = \arccos\!\left(\frac{-12}{\sqrt{858}}\right) \approx 114.2^\circ.</math>
 
</div>
</div>


<math>|\langle 4, 2, -4 \rangle| = \sqrt{4^2 + 2^2 + (-4)^2} = \sqrt{16 + 4 + 16} = \sqrt{36} = 6.</math>


===Intermediate===
===Intermediate===


An airplane is flying in still air at 240 m/s, 35° south of west. A wind blows at 80 m/s, 15° east of north. What must the plane’s new velocity relative to the air be in order to keep the same overall trajectory? Give your answer in components (with +x east and +y north).
An airplane is flying in still air at <math>240\ \text{m/s}</math>, <math>35^\circ</math> south of west. A wind begins blowing at <math>80\ \text{m/s}</math>, <math>15^\circ</math> east of north. What must the plane’s new velocity relative to the air be in order to keep the same overall trajectory? Give your answer in components with <math>+x</math> east and <math>+y</math> north.


[[File:Vectorsplaneproblem.png]]
[[File:Vectorsplaneproblem.png]]


**Solution:**
<div class="mw-collapsible mw-collapsed" data-expandtext="Show Solution" data-collapsetext="Hide Solution" style="border:1px solid #a2a9b1; padding:8px; background:#f8f9fa;">
'''Solution'''
<div class="mw-collapsible-content">


Let
Let:
* <math>\vec{v}_{p,0}</math> = original velocity of the plane (relative to air),
* <math>\vec{v}_w</math> = wind velocity (relative to ground),
* <math>\vec{v}_{p,1}</math> = new velocity of the plane relative to the air.


* <math>\vec{v_{p,0}}</math> = original velocity of the plane (relative to air), 
With the wind blowing, the plane's velocity relative to the ground is <math>\vec{v}_{p,1} + \vec{v}_w</math>. Requiring this resultant ground velocity to remain equal to <math>\vec{v}_{p,0}</math> gives:
* <math>\vec{v_w}</math> = wind velocity (relative to ground), 
* <math>\vec{v_{p,1}}</math> = new plane velocity (relative to air).


We want the **resultant ground velocity** of the plane to stay equal to <math>\vec{v_{p,0}}</math>. The velocity relative to the ground is
<math>\vec{v}_{p,1} + \vec{v}_w = \vec{v}_{p,0} \implies \vec{v}_{p,1} = \vec{v}_{p,0} - \vec{v}_w.</math>


<math>\vec{v_{p,1}} + \vec{v_w}.</math>
Express everything in components (<math>+x</math> east, <math>+y</math> north):
* <math>35^\circ</math> south of west corresponds to <math>\phi = 180^\circ + 35^\circ = 215^\circ</math> from the <math>+x</math>-axis:
:<math>\vec{v}_{p,0} = (240\cos 215^\circ,\; 240\sin 215^\circ)\ \text{m/s} \approx (-196.60,\; -137.66)\ \text{m/s}.</math>
* <math>15^\circ</math> east of north corresponds to <math>\phi = 90^\circ - 15^\circ = 75^\circ</math> from the <math>+x</math>-axis:
:<math>\vec{v}_w = (80\cos 75^\circ,\; 80\sin 75^\circ)\ \text{m/s} \approx (20.71,\; 77.27)\ \text{m/s}.</math>


So we require
Subtract component-wise:


<math>\vec{v_{p,1}} + \vec{v_w} = \vec{v_{p,0}}</math> 
<math>\vec{v}_{p,1} = \vec{v}_{p,0} - \vec{v}_w \approx (-196.60,\; -137.66) - (20.71,\; 77.27) \approx (-217.3,\; -214.9)\ \text{m/s}.</math>
<math>\Rightarrow \vec{v_{p,1}} = \vec{v_{p,0}} - \vec{v_w}.</math>


Express everything in components:
The plane must adjust its velocity relative to the air to approximately <math>(-217.3, -214.9)\ \text{m/s}</math> to maintain its original ground velocity.


Take +x as east and +y as north.
</div>
</div>


35° south of west corresponds to 215° from the +x-axis:
===Intermediate===


<math>\vec{v_{p,0}} = \langle 240\cos(215^\circ),\; 240\sin(215^\circ) \rangle \approx \langle -196.6,\; -137.7 \rangle\ \text{m/s}.</math>
A mechanic applies a force <math>\vec{F} = (30,\; 20,\; -20)\ \text{N}</math> to the end of a lever whose position vector relative to the pivot is <math>\vec{r} = (0.3,\; -0.4,\; 0.1)\ \text{m}</math>.


15° east of north corresponds to 75° from the +x-axis:
# Compute the torque vector <math>\vec{\tau} = \vec{r} \times \vec{F}</math> about the pivot.
# Find the magnitude <math>\|\vec{\tau}\|</math> of the torque.
# Verify using inner products that <math>\vec{\tau}</math> is orthogonal to both <math>\vec{r}</math> and <math>\vec{F}</math>, and state what vector you would obtain if you mistakenly computed <math>\vec{F} \times \vec{r}</math> instead.


<math>\vec{v_w} = \langle 80\cos(75^\circ),\; 80\sin(75^\circ) \rangle \approx \langle 20.7,\; 77.3 \rangle\ \text{m/s}.</math>
<div class="mw-collapsible mw-collapsed" data-expandtext="Show Solution" data-collapsetext="Hide Solution" style="border:1px solid #a2a9b1; padding:8px; background:#f8f9fa;">
'''Solution'''
<div class="mw-collapsible-content">


Now subtract:
'''1. Compute <math>\vec{\tau} = \vec{r} \times \vec{F}</math>:'''


<math>\vec{v_{p,1}} = \vec{v_{p,0}} - \vec{v_w} = \langle -196.6, -137.7 \rangle - \langle 20.7, 77.3 \rangle</math>
Using the determinant form (or component formula) with <math>\vec{r} = (0.3, -0.4, 0.1)\ \text{m}</math> and <math>\vec{F} = (30, 20, -20)\ \text{N}</math>:


<math>= \langle -217.3,\; -214.9 \rangle\ \text{m/s}.</math>
<math>\vec{\tau} = \begin{vmatrix} \hat{i} & \hat{j} & \hat{k} \\ 0.3 & -0.4 & 0.1 \\ 30 & 20 & -20 \end{vmatrix}\ \text{N}\cdot\text{m}</math>


So the plane must adjust its airspeed to approximately <math>\langle -217.3,\; -214.9 \rangle</math> m/s relative to the air to keep its original track.
Expand component by component (keeping track of the minus sign on the <math>\hat{j}</math> term):
* <math>\tau_x = (-0.4)(-20) - (0.1)(20) = 8 - 2 = 6\ \text{N}\cdot\text{m}</math>
* <math>\tau_y = -\big[(0.3)(-20) - (0.1)(30)\big] = -(-6 - 3) = 9\ \text{N}\cdot\text{m}</math>
* <math>\tau_z = (0.3)(20) - (-0.4)(30) = 6 - (-12) = 18\ \text{N}\cdot\text{m}</math>


===Difficult===
Thus,


Find the angle between the vectors <math>\langle 2, 5, -2 \rangle</math> and <math>\langle 3, -4, -1 \rangle</math>.
<math>\vec{\tau} = (6,\; 9,\; 18)\ \text{N}\cdot\text{m}.</math>


**Solution:**
''(Note: Although <math>\text{N}\cdot\text{m}</math> has the same SI base units as the joule, torque is conventionally written in <math>\text{N}\cdot\text{m}</math> to distinguish it from energy or work.)''


Use the dot product formula:
'''2. Find the magnitude <math>\|\vec{\tau}\|</math>:'''


<math>\vec{a}\cdot\vec{b} = |\vec{a}|\;|\vec{b}|\cos\theta.</math>
<math>\|\vec{\tau}\| = \sqrt{6^2 + 9^2 + 18^2}\ \text{N}\cdot\text{m} = \sqrt{36 + 81 + 324}\ \text{N}\cdot\text{m} = \sqrt{441}\ \text{N}\cdot\text{m} = 21\ \text{N}\cdot\text{m}.</math>


So
'''3. Verify orthogonality and anticommutativity:'''


<math>\theta = \cos^{-1}\left(\frac{\vec{a}\cdot\vec{b}}{|\vec{a}|\;|\vec{b}|}\right).</math>
Compute the inner product of <math>\vec{\tau}</math> with <math>\vec{r}</math> and with <math>\vec{F}</math>:


Compute the numerator:
<math>\langle \vec{\tau}, \vec{r} \rangle = 6(0.3) + 9(-0.4) + 18(0.1) = 1.8 - 3.6 + 1.8 = 0,</math>


<math>\vec{a}\cdot\vec{b} = 2(3) + 5(-4) + (-2)(-1) = 6 - 20 + 2 = -12.</math>
<math>\langle \vec{\tau}, \vec{F} \rangle = 6(30) + 9(20) + 18(-20) = 180 + 180 - 360 = 0.</math>


Compute the magnitudes:
Since both inner products vanish, <math>\vec{\tau}</math> is orthogonal to both <math>\vec{r}</math> and <math>\vec{F}</math>.


<math>|\vec{a}| = \sqrt{2^2 + 5^2 + (-2)^2} = \sqrt{4 + 25 + 4} = \sqrt{33},</math>
Finally, because the cross product is anticommutative (<math>\vec{F} \times \vec{r} = -(\vec{r} \times \vec{F})</math>), reversing the order flips every sign:


<math>|\vec{b}| = \sqrt{3^2 + (-4)^2 + (-1)^2} = \sqrt{9 + 16 + 1} = \sqrt{26}.</math>
<math>\vec{F} \times \vec{r} = -\vec{\tau} = (-6,\; -9,\; -18)\ \text{N}\cdot\text{m}.</math>


So
</div>
</div>


<math>\theta = \cos^{-1}\left(\frac{-12}{\sqrt{33}\sqrt{26}}\right) = \cos^{-1}\left(\frac{-12}{\sqrt{858}}\right) \approx 114^\circ.</math>
===Challenging===


==Connectedness==
Suppose <math>\vec{u}</math> and <math>\vec{v}</math> are two vectors in <math>\mathbf{R}^3</math> (or more generally <math>\mathbf{R}^n</math>) such that


Vectors appear in many everyday and engineering contexts.
<math>\|\vec{u}\| = 3, \qquad \|\vec{u} + \vec{v}\| = 4, \qquad \|\vec{u} - \vec{v}\| = 6.</math>
 
Without knowing any components of <math>\vec{u}</math> or <math>\vec{v}</math>, find the norm <math>\|\vec{v}\|</math> and the angle <math>\theta</math> between <math>\vec{u}</math> and <math>\vec{v}</math>.
 
<div class="mw-collapsible mw-collapsed" data-expandtext="Show Solution" data-collapsetext="Hide Solution" style="border:1px solid #a2a9b1; padding:8px; background:#f8f9fa;">
'''Solution'''
<div class="mw-collapsible-content">
 
Recall that the square of a vector's norm equals the inner product of the vector with itself: <math>\|x\|^2 = \langle x, x \rangle</math>. Expanding the squared norms of the sum and difference using the linearity and symmetry of the real inner product gives:
 
<math>\|\vec{u} + \vec{v}\|^2 = \langle \vec{u} + \vec{v},\; \vec{u} + \vec{v} \rangle = \|\vec{u}\|^2 + 2\langle \vec{u}, \vec{v} \rangle + \|\vec{v}\|^2</math>
 
<math>\|\vec{u} - \vec{v}\|^2 = \langle \vec{u} - \vec{v},\; \vec{u} - \vec{v} \rangle = \|\vec{u}\|^2 - 2\langle \vec{u}, \vec{v} \rangle + \|\vec{v}\|^2</math>
 
'''1. Find <math>\|\vec{v}\|</math> (Parallelogram Equality):'''
 
Adding the two equations cancels the <math>2\langle \vec{u}, \vec{v} \rangle</math> cross-term:
 
<math>\|\vec{u} + \vec{v}\|^2 + \|\vec{u} - \vec{v}\|^2 = 2\left(\|\vec{u}\|^2 + \|\vec{v}\|^2\right)</math>
 
Substitute the given norms (<math>\|\vec{u}\| = 3</math>, <math>\|\vec{u} + \vec{v}\| = 4</math>, <math>\|\vec{u} - \vec{v}\| = 6</math>):
 
<math>4^2 + 6^2 = 2\left(3^2 + \|\vec{v}\|^2\right)</math>
 
<math>16 + 36 = 2\left(9 + \|\vec{v}\|^2\right)</math>
 
<math>52 = 18 + 2\|\vec{v}\|^2 \implies 2\|\vec{v}\|^2 = 34 \implies \|\vec{v}\|^2 = 17</math>
 
Since a norm is always nonnegative:
 
<math>\|\vec{v}\| = \sqrt{17} \approx 4.12.</math>
 
'''2. Find the angle <math>\theta</math> between <math>\vec{u}</math> and <math>\vec{v}</math>:'''
 
Subtracting the second expansion from the first isolates the inner product:
 
<math>\|\vec{u} + \vec{v}\|^2 - \|\vec{u} - \vec{v}\|^2 = 4\langle \vec{u}, \vec{v} \rangle</math>
 
<math>16 - 36 = 4\langle \vec{u}, \vec{v} \rangle \implies \langle \vec{u}, \vec{v} \rangle = -5</math>
 
Applying the inner product angle formula:
 
<math>\cos\theta = \frac{\langle \vec{u}, \vec{v} \rangle}{\|\vec{u}\|\|\vec{v}\|} = \frac{-5}{3\sqrt{17}} \approx -0.4042</math>
 
<math>\theta = \arccos\!\left(\frac{-5}{3\sqrt{17}}\right) \approx 113.8^\circ.</math>
 
''Geometric & physics note:'' Think of <math>\vec{u}</math> and <math>\vec{v}</math> as two adjacent sides of a parallelogram (for example, two forces acting on a particle); then <math>\vec{u} + \vec{v}</math> and <math>\vec{u} - \vec{v}</math> are its two diagonals. The identity <math>\|\vec{u} + \vec{v}\|^2 + \|\vec{u} - \vec{v}\|^2 = 2(\|\vec{u}\|^2 + \|\vec{v}\|^2)</math> is the '''parallelogram equality''', which allows us to recover unknown norms and angles purely from length measurements—without ever choosing a coordinate system.


Consider a desk. Its weight is a force vector pointing downward, the normal force from the floor is a vector pointing upward, and the forces among the desk’s parts can all be represented as vectors. Measurements such as the diagonal distance across the desktop can also be seen as vectors from one corner to another.
</div>
</div>


Your motion can be described using vectors as well. Your **position** relative to some reference point can be written as a position vector. The difference between two position vectors is a displacement vector. **Velocity** describes how your position changes over time; it is the time derivative of the position vector, and its magnitude is your speed. **Acceleration** is the time derivative of velocity. All of these quantities can be broken into components, which makes it easier to analyze motion in each direction separately.
==Applications and History==


In Physics 2 and beyond, vectors are everywhere. The electric field, magnetic field, many forces, and other quantities are all vector fields. For example, the magnetic force on a charged particle is
===Applications Across Disciplines===
Vectors appear in many everyday and engineering contexts.


<math>\vec{F} = q\;\vec{v} \times \vec{B},</math>
Consider a desk. Its weight is a force vector pointing downward, the normal force from the floor is a vector pointing upward, and the forces among the desk’s parts can all be represented as vectors. Measurements such as the diagonal distance across the desktop can also be seen as vectors from one corner to another.


which combines a cross product of two vectors and a scalar multiplication.
Your motion can be described using vectors as well. Your '''position''' relative to some reference point can be written as a position vector. The difference between two position vectors is a displacement vector. '''Velocity''' describes how your position changes over time; it is the time derivative of the position vector, and its magnitude is your speed. '''Acceleration''' is the time derivative of velocity. All of these quantities can be broken into components, which makes it easier to analyze motion in each direction separately.


Even outside physics, vectors are central. In engineering, they are used for stress analysis, fluid flow, and control systems. In computer science, vectors appear in graphics, simulations, robotics, and machine learning (where data points are often vectors in high-dimensional spaces). Virtually any physical or abstract quantity that has both “how much” and “which way” can be modeled as a vector.
Vectors and units appear across everyday physical situations and virtually every STEM field:
* '''Electromagnetism and Fields:''' Electric fields <math>\vec{E}</math> and magnetic fields <math>\vec{B}</math> are vector fields that assign a vector to every point in space, interacting with charges through operations like the Lorentz force <math>\vec{F} = q(\vec{E} + \vec{v} \times \vec{B})</math>.
* '''Engineering:''' Structural stress analysis, fluid dynamics, robotics kinematics, control theory, and phasor analysis in AC electrical circuits all depend on vector spaces and inner products.
* '''Computer Science and Graphics:''' 2D/3D rendering engines use vectors for positions, surface normals, lighting (via dot products), and coordinate transformations, while machine learning models represent data points as vectors in high-dimensional spaces <math>\mathbf{R}^n</math>.
* '''Navigation:''' GPS receivers, aircraft, and ships continuously combine position, velocity, wind, and current vectors to compute headings and trajectories.


==History==
===History===


Ideas similar to vectors go back many centuries. Early uses treated them as directed line segments rather than abstract quantities. Hero of Alexandria’s work <i>Mechanics</i> in the first century AD contains one of the earliest known discussions of adding such directed segments.
Ideas similar to vectors go back many centuries. Early uses treated them as directed line segments rather than abstract quantities. Hero of Alexandria’s work ''Mechanics'' in the first century AD contains one of the earliest known discussions of adding such directed segments.


In the 18th and 19th centuries, several mathematicians used 2D vectors to represent complex numbers. Caspar Wessel, Jean-Robert Argand, Carl Friedrich Gauss, and William Rowan Hamilton all contributed to this viewpoint. One component represented the real part, and the other represented the imaginary part. Hamilton also introduced the term “vector.”
In the 18th and 19th centuries, several mathematicians used 2D vectors to represent complex numbers. Caspar Wessel, Jean-Robert Argand, Carl Friedrich Gauss, and William Rowan Hamilton all contributed to this viewpoint. One component represented the real part, and the other represented the imaginary part. Hamilton also introduced the term “vector.”


August Ferdinand Möbius, in his 1827 book <i>The Barycentric Calculus</i>, formalized many vector ideas, including labeling vectors with letters and defining scalar multiplication. Hermann Grassmann, in his 1844 work <i>Ausdehnungslehre</i> (“The Calculus of Extension”), developed a more general theory of vectors in spaces of arbitrary dimension and laid foundations for linear algebra.
August Ferdinand Möbius, in his 1827 book ''The Barycentric Calculus'', formalized many vector ideas, including labeling vectors with letters and defining scalar multiplication. Hermann Grassmann, in his 1844 work ''Ausdehnungslehre'' (“The Calculus of Extension”), developed a more general theory of vectors in spaces of arbitrary dimension and laid foundations for linear algebra.


The modern vector notation and conventions used in physics owe a lot to J. Willard Gibbs and Oliver Heaviside in the late 19th century. They refined vector methods and used them to express Maxwell’s equations of electromagnetism in the compact form we study today.
The modern vector notation and conventions used in physics owe a lot to J. Willard Gibbs and Oliver Heaviside in the late 19th century. They refined vector methods and used them to express Maxwell’s equations of electromagnetism in the compact form we study today.
Line 670: Line 721:


===External Links===
===External Links===
 
* [http://ocw.mit.edu/courses/mathematics/18-02sc-multivariable-calculus-fall-2010/1.-vectors-and-matrices/part-a-vectors-determinants-and-planes/session-1-vectors/MIT18_02SC_notes_0.pdf MIT OpenCourseWare 18.02SC: Vectors and Matrices Notes]
Mathematical computations on vectors (MIT OCW notes): 
* [https://www.glowscript.org/docs/VPythonDocs/vector.html VPython / GlowScript Vector Documentation]
[http://ocw.mit.edu/courses/mathematics/18-02sc-multivariable-calculus-fall-2010/1.-vectors-and-matrices/part-a-vectors-determinants-and-planes/session-1-vectors/MIT18_02SC_notes_0.pdf http://ocw.mit.edu/courses/mathematics/18-02sc-multivariable-calculus-fall-2010/1.-vectors-and-matrices/part-a-vectors-determinants-and-planes/session-1-vectors/MIT18_02SC_notes_0.pdf]
* [https://www.physics.uoguelph.ca/tutorials/vectors/vectors.html University of Guelph: Introductory Vector Tutorial]
 
Computational work with vectors in VPython: 
[http://vpython.org/contents/docs/vector.html http://vpython.org/contents/docs/vector.html]
 
Basic vector introduction: 
[https://www.physics.uoguelph.ca/tutorials/vectors/vectors.html https://www.physics.uoguelph.ca/tutorials/vectors/vectors.html]


===Further Reading===
===Further Reading===
 
* ''Linear Algebra Done Right'' – Sheldon Axler (2024)
* *Vector Analysis* – Josiah Willard Gibbs
* ''Vector Analysis'' – Josiah Willard Gibbs & Edwin Bidwell Wilson (1901)
* *Introduction to Matrices and Vectors* – Jacob T. Schwartz
* ''Introduction to Matrices and Vectors'' – Jacob T. Schwartz (1961)


==References==
==References==
 
* Axler, Sheldon. [https://linear.axler.net ''Linear Algebra Done Right''] (4th ed., Springer, 2024).
[https://mathinsight.org/definition/magnitude_vector https://mathinsight.org/definition/magnitude_vector]
* [https://mathinsight.org/vector_introduction Math Insight: An Introduction to Vectors]
[https://www.mathsisfun.com/algebra/vectors.html https://www.mathsisfun.com/algebra/vectors.html]
* [https://mathinsight.org/definition/magnitude_vector Math Insight: Magnitude of a Vector]
[http://ocw.mit.edu/courses/mathematics/18-02sc-multivariable-calculus-fall-2010/1.-vectors-and-matrices/part-a-vectors-determinants-and-planes/session-1-vectors/MIT18_02SC_notes_0.pdf http://ocw.mit.edu/courses/mathematics/18-02sc-multivariable-calculus-fall-2010/1.-vectors-and-matrices/part-a-vectors-determinants-and-planes/session-1-vectors/MIT18_02SC_notes_0.pdf] 
* [https://www.mathsisfun.com/algebra/vectors.html Math is Fun: Vectors]
[http://mathinsight.org/vector_introduction http://mathinsight.org/vector_introduction]
* [http://ocw.mit.edu/courses/mathematics/18-02sc-multivariable-calculus-fall-2010/1.-vectors-and-matrices/part-a-vectors-determinants-and-planes/session-1-vectors/MIT18_02SC_notes_0.pdf MIT OCW 18.02SC Multivariable Calculus: Session 1 Notes]
[http://www.math.mcgill.ca/labute/courses/133f03/VectorHistory.html http://www.math.mcgill.ca/labute/courses/133f03/VectorHistory.html]
* [http://www.math.mcgill.ca/labute/courses/133f03/VectorHistory.html McGill University: Brief History of Vectors]
[https://www.glowscript.org/docs/VPythonDocs/vector.html https://www.glowscript.org/docs/VPythonDocs/vector.html]
* [https://www.glowscript.org/docs/VPythonDocs/vector.html GlowScript / VPython Documentation: Vectors]
[https://www.glowscript.org/docs/VPythonDocs/arrow.html https://www.glowscript.org/docs/VPythonDocs/arrow.html]
* [https://www.glowscript.org/docs/VPythonDocs/arrow.html GlowScript / VPython Documentation: Arrow]
[https://www.britannica.com/science/vector-mathematics https://www.britannica.com/science/vector-mathematics]
* [https://www.britannica.com/science/vector-mathematics Encyclopædia Britannica: Vector (Mathematics)]
[https://www.grc.nasa.gov/www/k-12/rocket/vectcomp.html https://www.grc.nasa.gov/www/k-12/rocket/vectcomp.html]
* [https://www.grc.nasa.gov/www/k-12/rocket/vectcomp.html NASA Glenn Research Center: Vector Components]
[https://www.onlinemathlearning.com/dot-product.html https://www.onlinemathlearning.com/dot-product.html]
* [https://www.onlinemathlearning.com/dot-product.html Online Math Learning: Dot Product]


[[Category: Geometry]]
[[Category: Geometry]]

Revision as of 22:11, 24 November 2026

John Yang -- Fall 2026

Introduction

Vectors and units are used for precisely describing the physical world. A vector in introductory physics can be thought of as a quantity that has both magnitude (how big) and direction (which way). Many important physical quantities are vectors: displacement, velocity, acceleration, and force all need both size and direction to be specified. By representing these quantities as vectors, we can keep track of how they interact.

Units, meanwhile, tell us what we are measuring. A number by itself has no physical meaning until we attach a unit such as meters (m), seconds (s), or newtons (N). Consistent use of units helps us spot mistakes, compare results, and communicate clearly. Together, vectors and units allow scientists, engineers, and programmers to build models and make inferences and predictions for real-world behavior and to do computations that are physically meaningful.

In physics and engineering, vectors show up whenever we track motion, balance forces, or work with fields such as electric and magnetic fields. In computer science and related fields, vectors appear in computer graphics, simulations, game physics, machine learning, and data representation. Units give meaning to these values and ensure that all of these computations line up with real measurements. A strong grasp of both vectors and units is essential for problem solving, interpreting relations, and understanding of physics in general.

Notation Conventions

Introductory physics and pure mathematics often write the same vector concepts differently. Because this article bridges introductory physics and formal linear algebra, the table below summarizes both conventions and states the standard used on this page:

Concept Linear Algebra Introductory Physics Convention in This Article
Vector [math]\displaystyle{ v }[/math] (plain italic; distinguished by context) [math]\displaystyle{ \vec{v} }[/math], [math]\displaystyle{ \mathbf{v} }[/math], or [math]\displaystyle{ \overrightarrow{AB} }[/math] [math]\displaystyle{ v }[/math] in abstract definitions; [math]\displaystyle{ \vec{v} }[/math] in physics and [math]\displaystyle{ \mathbf{R}^3 }[/math]
Coordinate tuple (vector in [math]\displaystyle{ \mathbf{R}^3 }[/math]) [math]\displaystyle{ (v_x, v_y, v_z) }[/math] [math]\displaystyle{ \langle v_x, v_y, v_z \rangle }[/math] or [math]\displaystyle{ (v_x, v_y, v_z) }[/math] [math]\displaystyle{ (v_x, v_y, v_z) }[/math]
Inner product (dot product) [math]\displaystyle{ \langle u, v \rangle }[/math] [math]\displaystyle{ \vec{u} \cdot \vec{v} }[/math] [math]\displaystyle{ \langle u, v \rangle }[/math] (and [math]\displaystyle{ \vec{u} \cdot \vec{v} }[/math] in [math]\displaystyle{ \mathbf{R}^n }[/math])
Norm (magnitude) [math]\displaystyle{ \|v\| }[/math] [math]\displaystyle{ |\vec{v}| }[/math], [math]\displaystyle{ v }[/math], or [math]\displaystyle{ \|\vec{v}\|_2 }[/math] [math]\displaystyle{ \|v\| }[/math] or [math]\displaystyle{ \|\vec{v}\| }[/math]
Unit vector [math]\displaystyle{ u }[/math] with [math]\displaystyle{ \|u\| = 1 }[/math] [math]\displaystyle{ \hat{v} }[/math]; standard basis [math]\displaystyle{ \hat{i}, \hat{j}, \hat{k} }[/math] or [math]\displaystyle{ \hat{x}, \hat{y}, \hat{z} }[/math] [math]\displaystyle{ \hat{v} }[/math] and [math]\displaystyle{ \hat{i}, \hat{j}, \hat{k} }[/math] (or [math]\displaystyle{ \hat{x}, \hat{y}, \hat{z} }[/math])

Important note on angle brackets ([math]\displaystyle{ \langle \cdot, \cdot \rangle }[/math]): Many introductory physics textbooks and computational tools (including VPython's printed output) write coordinate vectors using angle brackets, such as [math]\displaystyle{ \vec{v} = \langle 3, -1, 2 \rangle }[/math], to visually separate vectors from points [math]\displaystyle{ (3, -1, 2) }[/math]. In mathematics and nonintroductory physics, however, this is an abuse of notation: angle brackets [math]\displaystyle{ \langle u, v \rangle }[/math] are reserved for the inner product of two vectors, which outputs a scalar rather than a vector. Writing both [math]\displaystyle{ \vec{v} = \langle v_x, v_y \rangle }[/math] and [math]\displaystyle{ \langle u, v \rangle }[/math] in the same setting creates ambiguity (especially in 2D, where both take two entries). To be unambiguous, this article strictly uses parentheses [math]\displaystyle{ (v_x, v_y, v_z) }[/math] for coordinate tuples and angle brackets [math]\displaystyle{ \langle u, v \rangle }[/math] exclusively for inner products.

Physical Examples and Visual Representation

Position and Displacement

A point's location in 3D space is described by a position vector [math]\displaystyle{ \vec{r} \in \mathbf{R}^3 }[/math] measured from a chosen origin [math]\displaystyle{ (0, 0, 0) }[/math]. Because position depends on where the origin is placed, a position vector is always anchored to a reference point. Given two position vectors [math]\displaystyle{ \vec{r}_1 }[/math] and [math]\displaystyle{ \vec{r}_2 }[/math], their difference

[math]\displaystyle{ \Delta \vec{r} = \vec{r}_2 - \vec{r}_1 }[/math]

is the relative position (or displacement) vector pointing from point 1 to point 2. Unlike position itself, displacement is independent of the choice of origin, and its norm [math]\displaystyle{ \|\vec{r}_2 - \vec{r}_1\| }[/math] equals the straight-line Euclidean distance between the two points.

Velocity

Velocity is a vector that describes how fast and in what direction an object moves. Its magnitude is the speed, and it is usually measured in m/s. The velocity vector can be found by differentiating the position vector with respect to time (if the position function is differentiable, that is).

[math]\displaystyle{ \vec{v}(t) = \frac{d\vec{r}}{dt} }[/math]

For example, if [math]\displaystyle{ \vec{r}(t) = (t, 1, 0)\ \text{m} }[/math], then:

[math]\displaystyle{ \vec{v}(t) = \frac{d\vec{r}}{dt} = (1, 0, 0)\ \text{m/s} }[/math]

The speed is the norm [math]\displaystyle{ \|\vec{v}(t)\| = \sqrt{1^2 + 0^2 + 0^2} = 1\ \text{m/s} }[/math].

Weight

Near Earth's surface, gravity exerts a downward force vector [math]\displaystyle{ \vec{F}_g }[/math] on an object of mass [math]\displaystyle{ m \gt 0 }[/math]. Choosing a coordinate system with the positive [math]\displaystyle{ y }[/math]-axis pointing upward,

[math]\displaystyle{ \vec{F}_g = (0, -mg, 0) }[/math]

where [math]\displaystyle{ g \approx 9.8\ \text{m/s}^2 }[/math] is the magnitude of the gravitational field near Earth’s surface. Weight refers to the norm [math]\displaystyle{ \|\vec{F}_g\| = mg }[/math] whereas [math]\displaystyle{ \vec{F}_g }[/math] is the gravitational force vector.

Visualizing Vectors

In [math]\displaystyle{ \mathbf{R}^2 }[/math] and [math]\displaystyle{ \mathbf{R}^3 }[/math], vectors are drawn as arrows: the length of the arrow represents the norm, and the direction of the arrow indicates which way it points. Mathematically, vectors in [math]\displaystyle{ \mathbf{R}^n }[/math] are invariant under parallel translation: sliding an arrow without changing its length or orientation produces the same vector. In physics, this invariance is useful because a vector does not always represent a literal displacement between two locations. It often describes a physical property defined at a single point (such as velocity, force, or an electric field). In diagrams, we anchor the tail of such a vector at the point where it acts.

The example below shows a velocity vector for a ball moving to the right at 5 m/s.

Units and Measurement

SI Base Units

The International System of Units (SI) is the standard measurement system in science and engineering. It defines seven base units from which all other SI units are constructed:

  • meter ([math]\displaystyle{ \text{m} }[/math]) – length
  • kilogram ([math]\displaystyle{ \text{kg} }[/math]) – mass
  • second ([math]\displaystyle{ \text{s} }[/math]) – time
  • ampere ([math]\displaystyle{ \text{A} }[/math]) – electric current
  • kelvin ([math]\displaystyle{ \text{K} }[/math]) – thermodynamic temperature
  • mole ([math]\displaystyle{ \text{mol} }[/math]) – amount of substance
  • candela ([math]\displaystyle{ \text{cd} }[/math]) – luminous intensity

All vector quantities in introductory physics carry combinations of these base units.

Derived Units

Derived units are formed by combining SI base units through multiplication and division. Common examples include:

  • newton ([math]\displaystyle{ \text{N} = \text{kg}\cdot\text{m/s}^2 }[/math]) – force
  • joule ([math]\displaystyle{ \text{J} = \text{N}\cdot\text{m} = \text{kg}\cdot\text{m}^2/\text{s}^2 }[/math]) – energy and work
  • watt ([math]\displaystyle{ \text{W} = \text{J/s} }[/math]) – power
  • tesla ([math]\displaystyle{ \text{T} = \text{N}\cdot\text{s}/(\text{C}\cdot\text{m}) = \text{kg}/(\text{A}\cdot\text{s}^2) }[/math]) – magnetic field

Unit Conversion and Dimensional Consistency

Unit conversion changes a quantity from one unit to another while representing the same physical amount (for example, converting from centimeters to meters or from kilometers per hour to meters per second). In multi-step physics problems, careful unit conversion is essential to avoid errors and to match the units expected in formulas. In vector calculations, dimensional consistency requires that every coordinate of a vector shares the same unit.

Formal Definition

Vector Space Axioms

Formally, a vector (or point) is an element of a vector space. Let [math]\displaystyle{ \mathbf{F} }[/math] denote either the field of real numbers [math]\displaystyle{ \mathbf{R} }[/math] or the field of complex numbers [math]\displaystyle{ \mathbf{C} }[/math] (in introductory physics, [math]\displaystyle{ \mathbf{F} = \mathbf{R} }[/math]); elements of [math]\displaystyle{ \mathbf{F} }[/math] are called scalars.

A vector space over [math]\displaystyle{ \mathbf{F} }[/math] is a set [math]\displaystyle{ V }[/math] equipped with two operations:

  • Addition ([math]\displaystyle{ V \times V \to V }[/math]): assigns an element [math]\displaystyle{ u + v \in V }[/math] to each pair [math]\displaystyle{ u, v \in V }[/math].
  • Scalar multiplication ([math]\displaystyle{ \mathbf{F} \times V \to V }[/math]): assigns an element [math]\displaystyle{ \lambda v \in V }[/math] to each [math]\displaystyle{ \lambda \in \mathbf{F} }[/math] and [math]\displaystyle{ v \in V }[/math].

(Because both operations map back into [math]\displaystyle{ V }[/math], closure under addition and scalar multiplication is built directly into the definition.) These operations must satisfy the following axioms for all [math]\displaystyle{ u, v, w \in V }[/math] and all [math]\displaystyle{ a, b \in \mathbf{F} }[/math]:

  • Commutativity: [math]\displaystyle{ u + v = v + u }[/math]
  • Associativity: [math]\displaystyle{ (u + v) + w = u + (v + w) }[/math] and [math]\displaystyle{ (ab)v = a(bv) }[/math]
  • Additive identity: There exists an element [math]\displaystyle{ 0 \in V }[/math] (the zero vector, distinct from the scalar [math]\displaystyle{ 0 \in \mathbf{F} }[/math]) such that [math]\displaystyle{ v + 0 = v }[/math]
  • Additive inverse: For every [math]\displaystyle{ v \in V }[/math], there exists [math]\displaystyle{ w \in V }[/math] such that [math]\displaystyle{ v + w = 0 }[/math]
  • Multiplicative identity: [math]\displaystyle{ 1v = v }[/math]
  • Distributivity: [math]\displaystyle{ a(u + v) = au + av }[/math] and [math]\displaystyle{ (a + b)v = av + bv }[/math]

From these axioms, we can prove that the additive identity [math]\displaystyle{ 0 \in V }[/math] is unique, every vector [math]\displaystyle{ v \in V }[/math] has a unique additive inverse denoted [math]\displaystyle{ -v }[/math], and [math]\displaystyle{ (-1)v = -v }[/math] and [math]\displaystyle{ 0v = 0 }[/math] for every [math]\displaystyle{ v \in V }[/math] (do these as an exercise).

In introductory physics, we almost always work in the real vector spaces [math]\displaystyle{ \mathbf{R}^2 }[/math] (the plane) or [math]\displaystyle{ \mathbf{R}^3 }[/math] (ordinary 3D space), which are special cases of [math]\displaystyle{ \mathbf{R}^n }[/math]—the set of all ordered lists of [math]\displaystyle{ n }[/math] real numbers, such as [math]\displaystyle{ v = (v_x, v_y, v_z) \in \mathbf{R}^3 }[/math], with coordinate-wise addition and scalar multiplication. For example, [math]\displaystyle{ v = (1, 0, 0) \in \mathbf{R}^3 }[/math] is a vector of length [math]\displaystyle{ 1 }[/math] pointing along the positive [math]\displaystyle{ x }[/math]-axis.

Inner Products and Norms

A general vector space does not necessarily include a notion of length or angle. To introduce geometry, we equip a real vector space [math]\displaystyle{ V }[/math] with an inner product, which is a function assigning a real scalar [math]\displaystyle{ \langle u, v \rangle \in \mathbf{R} }[/math] to each pair [math]\displaystyle{ u, v \in V }[/math] such that, for all [math]\displaystyle{ u, v, w \in V }[/math] and [math]\displaystyle{ \lambda \in \mathbf{R} }[/math]:

  • Positive definiteness: [math]\displaystyle{ \langle v, v \rangle \ge 0 }[/math], with [math]\displaystyle{ \langle v, v \rangle = 0 }[/math] if and only if [math]\displaystyle{ v = 0 }[/math].
  • Linearity in the first slot: [math]\displaystyle{ \langle u + w, v \rangle = \langle u, v \rangle + \langle w, v \rangle }[/math] and [math]\displaystyle{ \langle \lambda u, v \rangle = \lambda \langle u, v \rangle }[/math].
  • Symmetry: [math]\displaystyle{ \langle u, v \rangle = \langle v, u \rangle }[/math] (which, combined with linearity in the first slot, also guarantees linearity in the second slot).

A vector space equipped with an inner product is called an inner product space. In [math]\displaystyle{ \mathbf{R}^n }[/math], the standard Euclidean inner product (which we call the dot product) of [math]\displaystyle{ u = (u_1, \dots, u_n) }[/math] and [math]\displaystyle{ v = (v_1, \dots, v_n) }[/math] is defined by:

[math]\displaystyle{ \langle u, v \rangle = u_1 v_1 + u_2 v_2 + \cdots + u_n v_n = \sum_{i=1}^{n} u_i v_i }[/math]

From the inner product, we define the norm (commonly called magnitude in physics) of a vector [math]\displaystyle{ v \in \mathbf{R}^n }[/math] as the nonnegative scalar:

[math]\displaystyle{ \|v\| = \sqrt{\langle v, v \rangle} = \sqrt{v_1^2 + v_2^2 + \cdots + v_n^2} = \sqrt{\sum_{i=1}^{n} v_i^2} }[/math]

In 3D Cartesian space, for [math]\displaystyle{ v = (v_x, v_y, v_z) \in \mathbf{R}^3 }[/math], this is the familiar Pythagorean formula:

[math]\displaystyle{ \|v\| = \sqrt{v_x^2 + v_y^2 + v_z^2} }[/math]

Unit Vectors

A unit vector is a vector with norm [math]\displaystyle{ 1 }[/math]. For any nonzero vector [math]\displaystyle{ v \in \mathbf{R}^n }[/math], scaling [math]\displaystyle{ v }[/math] by the positive scalar [math]\displaystyle{ \frac{1}{\|v\|} }[/math] yields a unit vector in the same direction (a process called normalization):

[math]\displaystyle{ \hat{v} = \frac{1}{\|v\|}v }[/math]

For example, if [math]\displaystyle{ \vec{v} = (v_x, v_y, v_z) \in \mathbf{R}^3 }[/math] is nonzero, then [math]\displaystyle{ \hat{v} = \frac{1}{\|\vec{v}\|}(v_x, v_y, v_z) }[/math]. Note that unit vectors carry no physical units because the units of [math]\displaystyle{ \vec{v} }[/math] and [math]\displaystyle{ \|\vec{v}\| }[/math] cancel.

Orthonormal Bases

Two vectors [math]\displaystyle{ u, v }[/math] in an inner product space are called orthogonal if [math]\displaystyle{ \langle u, v \rangle = 0 }[/math]. A list of vectors [math]\displaystyle{ e_1, \dots, e_n }[/math] is orthonormal if every vector has norm [math]\displaystyle{ 1 }[/math] and every pair of distinct vectors is orthogonal ([math]\displaystyle{ \langle e_j, e_k \rangle = 0 }[/math] for [math]\displaystyle{ j \neq k }[/math]).

The standard basis of [math]\displaystyle{ \mathbf{R}^3 }[/math] is an orthonormal basis consisting of the three unit vectors:

[math]\displaystyle{ \hat{x} = (1, 0, 0), \qquad \hat{y} = (0, 1, 0), \qquad \hat{z} = (0, 0, 1) }[/math]

(also sometimes written [math]\displaystyle{ \hat{i}, \hat{j}, \hat{k} }[/math] in physics and engineering). We can think of a basis as a fundamental list of vectors for a vector space that gives each component its meaning. For the standard basis, our list gives each component a meaning that it is the x, y, or z direction. This basis is orthonormal, so every vector [math]\displaystyle{ v \in \mathbf{R}^3 }[/math] can be written uniquely as a linear combination whose coefficients are simply the inner products of [math]\displaystyle{ v }[/math] with each basis vector:

[math]\displaystyle{ v = \langle v, \hat{x} \rangle \hat{x} + \langle v, \hat{y} \rangle \hat{y} + \langle v, \hat{z} \rangle \hat{z} }[/math]

Other coordinate systems use different local orthonormal bases that vary with position, such as [math]\displaystyle{ \hat{r} }[/math] and [math]\displaystyle{ \hat{\theta} }[/math] in polar coordinates.

Direction and Angles

In [math]\displaystyle{ \mathbf{R}^2 }[/math] and [math]\displaystyle{ \mathbf{R}^3 }[/math], scalar multiplication gives a direct geometric interpretation of direction: for a nonzero [math]\displaystyle{ v }[/math], multiplying by [math]\displaystyle{ \lambda \gt 0 }[/math] scales its norm without changing its direction, while multiplying by [math]\displaystyle{ \lambda \lt 0 }[/math] reverses its direction (with [math]\displaystyle{ (-1)v = -v }[/math] pointing directly opposite to [math]\displaystyle{ v }[/math]). The zero vector [math]\displaystyle{ 0 = (0, \dots, 0) }[/math] has norm [math]\displaystyle{ 0 }[/math] and no direction.

To quantify relative direction between any two nonzero vectors [math]\displaystyle{ u, v \in \mathbf{R}^n }[/math], we rely on the Cauchy–Schwarz inequality:

[math]\displaystyle{ |\langle u, v \rangle| \le \|u\|\|v\| }[/math]

Dividing by [math]\displaystyle{ \|u\|\|v\| \gt 0 }[/math] guarantees that [math]\displaystyle{ -1 \le \frac{\langle u, v \rangle}{\|u\|\|v\|} \le 1 }[/math]. Because of this, there exists a unique angle [math]\displaystyle{ \theta \in [0, \pi] }[/math] between [math]\displaystyle{ u }[/math] and [math]\displaystyle{ v }[/math] where:

[math]\displaystyle{ \cos\theta = \frac{\langle u, v \rangle}{\|u\|\|v\|} }[/math]

Two nonzero vectors are orthogonal ([math]\displaystyle{ \langle u, v \rangle = 0 }[/math]) if and only if [math]\displaystyle{ \cos\theta = 0 }[/math], meaning they are perpendicular ([math]\displaystyle{ \theta = \frac{\pi}{2} }[/math]).

Unsigned angle vs. 2D polar direction angle: Notice that the inner-product angle [math]\displaystyle{ \theta = \arccos\left(\frac{\langle v, \hat{x}\rangle}{\|v\|}\right) = \arccos\left(\frac{v_x}{\|v\|}\right) }[/math] always lies in [math]\displaystyle{ [0, \pi] }[/math] and therefore cannot distinguish whether a 2D vector points above or below the [math]\displaystyle{ x }[/math]-axis (it loses the sign of [math]\displaystyle{ v_y }[/math]). In introductory 2D physics, we instead specify a vector's full orientation using a signed polar direction angle [math]\displaystyle{ \phi \in (-\pi, \pi] }[/math] (or [math]\displaystyle{ [0, 2\pi) }[/math]) measured counterclockwise from the positive [math]\displaystyle{ x }[/math]-axis. For a nonzero vector [math]\displaystyle{ v = (v_x, v_y) \in \mathbf{R}^2 }[/math]:

  • If [math]\displaystyle{ v_x \gt 0 }[/math]: [math]\displaystyle{ \phi = \arctan\left(\frac{v_y}{v_x}\right) }[/math].
  • If [math]\displaystyle{ v_x \lt 0 }[/math]: [math]\displaystyle{ \phi = \arctan\left(\frac{v_y}{v_x}\right) + \pi }[/math] (or [math]\displaystyle{ -\pi }[/math], depending on the chosen branch) to place [math]\displaystyle{ \phi }[/math] in the second or third quadrant.
  • If [math]\displaystyle{ v_x = 0 }[/math]: [math]\displaystyle{ \phi = \frac{\pi}{2} }[/math] ([math]\displaystyle{ 90^\circ }[/math]) when [math]\displaystyle{ v_y \gt 0 }[/math], and [math]\displaystyle{ \phi = -\frac{\pi}{2} }[/math] ([math]\displaystyle{ 270^\circ }[/math]) when [math]\displaystyle{ v_y \lt 0 }[/math].

Vector Operations

Vector addition and scalar multiplication are built into every vector space. The dot product and cross product add geometric structure for measuring projections, angles, areas, and orientations. Below, formulas are written in [math]\displaystyle{ \mathbf{R}^3 }[/math] for introductory physics, with notes on how they generalize to [math]\displaystyle{ \mathbf{R}^n }[/math].

Addition and Subtraction

In [math]\displaystyle{ \mathbf{R}^n }[/math], vector addition is defined coordinate-wise. For [math]\displaystyle{ \vec{a} = (a_x, a_y, a_z) }[/math] and [math]\displaystyle{ \vec{b} = (b_x, b_y, b_z) }[/math] in [math]\displaystyle{ \mathbf{R}^3 }[/math]:

[math]\displaystyle{ \vec{a} + \vec{b} = (a_x + b_x,\; a_y + b_y,\; a_z + b_z) }[/math]

By the vector space axioms, addition is commutative ([math]\displaystyle{ \vec{a} + \vec{b} = \vec{b} + \vec{a} }[/math]) and associative ([math]\displaystyle{ (\vec{a} + \vec{b}) + \vec{c} = \vec{a} + (\vec{b} + \vec{c}) }[/math]). Geometrically, placing the tail of [math]\displaystyle{ \vec{b} }[/math] at the head of [math]\displaystyle{ \vec{a} }[/math] yields the resultant vector [math]\displaystyle{ \vec{a} + \vec{b} }[/math], running from the tail of [math]\displaystyle{ \vec{a} }[/math] to the head of [math]\displaystyle{ \vec{b} }[/math].

Every vector [math]\displaystyle{ \vec{b} }[/math] has a unique additive inverse [math]\displaystyle{ -\vec{b} = (-1)\vec{b} }[/math], which has the same norm as [math]\displaystyle{ \vec{b} }[/math] but points in the opposite direction. Vector subtraction is formally defined as adding this additive inverse; for 3-dimensional vectors:

[math]\displaystyle{ \vec{a} - \vec{b} = \vec{a} + (-\vec{b}) = (a_x - b_x,\; a_y - b_y,\; a_z - b_z) }[/math]

Image: 500 pixels

Scalar Multiplication

For a scalar [math]\displaystyle{ \lambda \in \mathbf{R} }[/math] and a vector [math]\displaystyle{ \vec{a} = (a_x, a_y, a_z) \in \mathbf{R}^3 }[/math], scalar multiplication multiplies every coordinate by [math]\displaystyle{ \lambda }[/math]:

[math]\displaystyle{ \lambda \vec{a} = (\lambda a_x,\; \lambda a_y,\; \lambda a_z) }[/math]

This scales the norm by [math]\displaystyle{ |\lambda| }[/math] (that is, [math]\displaystyle{ \|\lambda \vec{a}\| = |\lambda|\|\vec{a}\| }[/math]). If [math]\displaystyle{ \lambda \gt 0 }[/math], direction is preserved; if [math]\displaystyle{ \lambda \lt 0 }[/math], direction is reversed; if [math]\displaystyle{ \lambda = 0 }[/math], the result is the zero vector [math]\displaystyle{ \vec{0} }[/math].

Image: 400 pixels

Vector spaces do not include a separate "division by a scalar" axiom (nor is division by a vector defined). Instead, because every nonzero scalar [math]\displaystyle{ \lambda \in \mathbf{R} }[/math] has a unique multiplicative inverse [math]\displaystyle{ \frac{1}{\lambda} \in \mathbf{R} }[/math], dividing a vector by [math]\displaystyle{ \lambda \neq 0 }[/math] is simply scalar multiplication by [math]\displaystyle{ \frac{1}{\lambda} }[/math]:

[math]\displaystyle{ \frac{\vec{a}}{\lambda} = \frac{1}{\lambda}\vec{a} = \left(\frac{a_x}{\lambda},\; \frac{a_y}{\lambda},\; \frac{a_z}{\lambda}\right) }[/math]

Dot Product

The dot product (or scalar product) is the Euclidean inner product on [math]\displaystyle{ \mathbf{R}^n }[/math]. For [math]\displaystyle{ \vec{a} = (a_x, a_y, a_z) }[/math] and [math]\displaystyle{ \vec{b} = (b_x, b_y, b_z) }[/math] in [math]\displaystyle{ \mathbf{R}^3 }[/math]:

[math]\displaystyle{ \vec{a} \cdot \vec{b} = \langle \vec{a}, \vec{b} \rangle = a_x b_x + a_y b_y + a_z b_z }[/math]

Unlike scalar multiplication, the dot product takes two vectors and outputs a scalar. For nonzero vectors separated by angle [math]\displaystyle{ \theta \in [0, \pi] }[/math], it satisfies:

[math]\displaystyle{ \vec{a} \cdot \vec{b} = \|\vec{a}\|\|\vec{b}\|\cos\theta }[/math]

Geometrically, [math]\displaystyle{ \vec{a} \cdot \hat{b} = \|\vec{a}\|\cos\theta }[/math] gives the signed projection of [math]\displaystyle{ \vec{a} }[/math] onto the direction of [math]\displaystyle{ \vec{b} }[/math]—which is why mechanical work by a constant force is written [math]\displaystyle{ W = \vec{F} \cdot \Delta\vec{r} }[/math]. While the zero vector is formally orthogonal to every vector ([math]\displaystyle{ \vec{0} \cdot \vec{v} = 0 }[/math]), two nonzero vectors are perpendicular ([math]\displaystyle{ \theta = \frac{\pi}{2} }[/math]) if and only if [math]\displaystyle{ \vec{a} \cdot \vec{b} = 0 }[/math].

Image: 400 pixels

Cross Product

In [math]\displaystyle{ \mathbf{R}^3 }[/math], the cross product (or vector product) of [math]\displaystyle{ \vec{a} = (a_x, a_y, a_z) }[/math] and [math]\displaystyle{ \vec{b} = (b_x, b_y, b_z) }[/math] is a new vector defined in components by:

[math]\displaystyle{ \vec{a} \times \vec{b} = (a_y b_z - a_z b_y,\; a_z b_x - a_x b_z,\; a_x b_y - a_y b_x) }[/math]

Written in the standard orthonormal basis [math]\displaystyle{ \hat{i}, \hat{j}, \hat{k} }[/math], this is equivalently:

[math]\displaystyle{ \vec{a} \times \vec{b} = (a_y b_z - a_z b_y)\hat{i} - (a_x b_z - a_z b_x)\hat{j} + (a_x b_y - a_y b_x)\hat{k} }[/math]

The cross product is bilinear (linear in each argument separately) and anticommutative—swapping the order reverses the sign: [math]\displaystyle{ \vec{b} \times \vec{a} = -(\vec{a} \times \vec{b}) }[/math]. In particular, [math]\displaystyle{ \vec{a} \times \vec{a} = \vec{0} }[/math] for every vector [math]\displaystyle{ \vec{a} }[/math].

A standard mnemonic for computing [math]\displaystyle{ \vec{a} \times \vec{b} }[/math] is the formal determinant of a [math]\displaystyle{ 3 \times 3 }[/math] symbolic matrix, expanded along the first row (observing the alternating [math]\displaystyle{ +, -, + }[/math] signs of cofactor expansion):

[math]\displaystyle{ \vec{a} \times \vec{b} = \begin{vmatrix} \hat{i} & \hat{j} & \hat{k} \\ a_x & a_y & a_z \\ b_x & b_y & b_z \end{vmatrix} = \begin{vmatrix} a_y & a_z \\ b_y & b_z \end{vmatrix}\hat{i} - \begin{vmatrix} a_x & a_z \\ b_x & b_z \end{vmatrix}\hat{j} + \begin{vmatrix} a_x & a_y \\ b_x & b_y \end{vmatrix}\hat{k} }[/math]

Online resources for checking computations:

Geometrically, the norm of the cross product equals the area of the parallelogram spanned by [math]\displaystyle{ \vec{a} }[/math] and [math]\displaystyle{ \vec{b} }[/math]:

[math]\displaystyle{ \|\vec{a} \times \vec{b}\| = \|\vec{a}\|\|\vec{b}\|\sin\theta }[/math]

where [math]\displaystyle{ \theta \in [0, \pi] }[/math] is the angle between [math]\displaystyle{ \vec{a} }[/math] and [math]\displaystyle{ \vec{b} }[/math]. Its direction is orthogonal to both [math]\displaystyle{ \vec{a} }[/math] and [math]\displaystyle{ \vec{b} }[/math] and is uniquely determined by the Right Hand Rule. In introductory physics, the cross product governs rotational and electromagnetic phenomena such as torque ([math]\displaystyle{ \vec{\tau} = \vec{r} \times \vec{F} }[/math]), angular momentum ([math]\displaystyle{ \vec{L} = \vec{r} \times \vec{p} }[/math]), and the magnetic Lorentz force ([math]\displaystyle{ \vec{F}_B = q(\vec{v} \times \vec{B}) }[/math]).

Component Pattern ("X-Method")

A fast computational pattern avoids writing out the full [math]\displaystyle{ 3 \times 3 }[/math] determinant. Consider:

[math]\displaystyle{ \vec{a} = (3, -2, 4), \qquad \vec{b} = (-1, 6, 3) }[/math]

To compute [math]\displaystyle{ \vec{c} = \vec{a} \times \vec{b} = (c_x, c_y, c_z) }[/math], list each vector's components vertically and append the first component at the bottom:

[math]\displaystyle{ \begin{pmatrix} a_x \\ a_y \\ a_z \\ a_x \end{pmatrix} = \begin{pmatrix} 3 \\ -2 \\ 4 \\ 3 \end{pmatrix}, \qquad \begin{pmatrix} b_x \\ b_y \\ b_z \\ b_x \end{pmatrix} = \begin{pmatrix} -1 \\ 6 \\ 3 \\ -1 \end{pmatrix} }[/math]

  • For [math]\displaystyle{ c_x }[/math], cross-multiply rows 2 and 3 ([math]\displaystyle{ a_y b_z - a_z b_y }[/math]):

[math]\displaystyle{ c_x = (-2)(3) - (4)(6) = -6 - 24 = -30 }[/math]
  • For [math]\displaystyle{ c_y }[/math], cross-multiply rows 3 and 4 ([math]\displaystyle{ a_z b_x - a_x b_z }[/math]):

[math]\displaystyle{ c_y = (4)(-1) - (3)(3) = -4 - 9 = -13 }[/math]
  • For [math]\displaystyle{ c_z }[/math], cross-multiply rows 1 and 2 ([math]\displaystyle{ a_x b_y - a_y b_x }[/math]):

[math]\displaystyle{ c_z = (3)(6) - (-2)(-1) = 18 - 2 = 16 }[/math]

Thus [math]\displaystyle{ \vec{a} \times \vec{b} = (-30, -13, 16) }[/math]. As a quick sanity check, verify orthogonality via the dot product: [math]\displaystyle{ \vec{a} \cdot \vec{c} = 3(-30) + (-2)(-13) + 4(16) = 0 }[/math].


Advanced Note: What the Cross Product Really Measures (and Why 3D Is Special)

Optional Reading (Geometric and Linear Algebra Interpretation)

At first glance, the component formula for [math]\displaystyle{ \vec{a} \times \vec{b} }[/math] seems arbitrary, and it is unclear where the [math]\displaystyle{ 3 \times 3 }[/math] determinant comes from. Two viewpoints make both completely transparent and explain what happens outside 3D.

1. Components as Signed Shadow Areas

Look at the three components of [math]\displaystyle{ \vec{c} = \vec{a} \times \vec{b} }[/math]:

[math]\displaystyle{ c_x = a_y b_z - a_z b_y, \qquad c_y = a_z b_x - a_x b_z, \qquad c_z = a_x b_y - a_y b_x }[/math]

In 2D, the expression [math]\displaystyle{ a_x b_y - a_y b_x }[/math] is the signed area of the parallelogram spanned by [math]\displaystyle{ (a_x, a_y) }[/math] and [math]\displaystyle{ (b_x, b_y) }[/math] (positive if rotating from [math]\displaystyle{ \vec{a} }[/math] to [math]\displaystyle{ \vec{b} }[/math] is counterclockwise, negative if clockwise). Therefore, the three components of [math]\displaystyle{ \vec{a} \times \vec{b} }[/math] can be seen as the signed areas of the shadows cast by the 3D parallelogram onto the three coordinate planes:

  • [math]\displaystyle{ c_x }[/math] is the signed area of the shadow on the [math]\displaystyle{ yz }[/math]-plane (perpendicular to the [math]\displaystyle{ x }[/math]-axis).
  • [math]\displaystyle{ c_y }[/math] is the signed area of the shadow on the [math]\displaystyle{ zx }[/math]-plane (perpendicular to the [math]\displaystyle{ y }[/math]-axis).
  • [math]\displaystyle{ c_z }[/math] is the signed area of the shadow on the [math]\displaystyle{ xy }[/math]-plane (perpendicular to the [math]\displaystyle{ z }[/math]-axis).

Then the formula [math]\displaystyle{ \|\vec{a} \times \vec{b}\| = \sqrt{c_x^2 + c_y^2 + c_z^2} }[/math] is a 3D Pythagorean theorem for areas: the squared area of any tilted parallelogram equals the sum of the squared areas of its three coordinate-plane shadows.

2. The Determinant Formula as Signed Volume

Fix two vectors [math]\displaystyle{ \vec{a}, \vec{b} \in \mathbf{R}^3 }[/math]. For any third vector [math]\displaystyle{ \vec{v} = (v_x, v_y, v_z) \in \mathbf{R}^3 }[/math], the [math]\displaystyle{ 3 \times 3 }[/math] determinant

[math]\displaystyle{ V(\vec{v}) = \det\begin{pmatrix} v_x & v_y & v_z \\ a_x & a_y & a_z \\ b_x & b_y & b_z \end{pmatrix} }[/math]

gives the signed volume of the parallelepiped spanned by [math]\displaystyle{ \vec{a} }[/math], [math]\displaystyle{ \vec{b} }[/math], and [math]\displaystyle{ \vec{v} }[/math]. Expanding along the first row shows that [math]\displaystyle{ V(\vec{v}) }[/math] is simply a linear combination of [math]\displaystyle{ v_x, v_y, v_z }[/math]:

[math]\displaystyle{ V(\vec{v}) = (a_y b_z - a_z b_y)v_x + (a_z b_x - a_x b_z)v_y + (a_x b_y - a_y b_x)v_z = \langle \vec{c}, \vec{v} \rangle }[/math]

In linear algebra, the cross product [math]\displaystyle{ \vec{c} = \vec{a} \times \vec{b} }[/math] is defined as the unique vector whose inner product with any [math]\displaystyle{ \vec{v} }[/math] computes this signed volume: [math]\displaystyle{ \langle \vec{a} \times \vec{b}, \vec{v} \rangle = V(\vec{v}) }[/math]. This single equation explains every property of the cross product at once:

  • Why the determinant works: Replacing [math]\displaystyle{ (v_x, v_y, v_z) }[/math] with [math]\displaystyle{ (\hat{i}, \hat{j}, \hat{k}) }[/math] is just a compact way of collecting the coefficients of [math]\displaystyle{ v_x, v_y, v_z }[/math] into the vector [math]\displaystyle{ \vec{c} }[/math].
  • Orthogonality: Setting [math]\displaystyle{ \vec{v} = \vec{a} }[/math] or [math]\displaystyle{ \vec{v} = \vec{b} }[/math] flattens the parallelepiped to volume [math]\displaystyle{ 0 }[/math], so [math]\displaystyle{ \langle \vec{a} \times \vec{b}, \vec{a} \rangle = 0 }[/math] and [math]\displaystyle{ \langle \vec{a} \times \vec{b}, \vec{b} \rangle = 0 }[/math].
  • Magnitude = Base Area: Setting [math]\displaystyle{ \vec{v} = \hat{n} }[/math] (the unit vector pointing in the direction of [math]\displaystyle{ \vec{a} \times \vec{b} }[/math]) builds a parallelepiped of height [math]\displaystyle{ 1 }[/math] over the base spanned by [math]\displaystyle{ \vec{a} }[/math] and [math]\displaystyle{ \vec{b} }[/math]. Its volume equals [math]\displaystyle{ (\text{base area}) \times 1 }[/math], while [math]\displaystyle{ \langle \vec{a} \times \vec{b}, \hat{n} \rangle = \|\vec{a} \times \vec{b}\| }[/math].
  • Right-hand rule: Setting [math]\displaystyle{ \vec{v} = \vec{a} \times \vec{b} }[/math] gives volume [math]\displaystyle{ \|\vec{a} \times \vec{b}\|^2 \gt 0 }[/math] (for non-parallel [math]\displaystyle{ \vec{a}, \vec{b} }[/math]), forcing [math]\displaystyle{ (\vec{a}, \vec{b}, \vec{a} \times \vec{b}) }[/math] to have positive (right-handed) orientation.

3. Why Two-Vector Cross Products Are Special to 3D (and the 7D Exception)

Suppose you have two non-parallel vectors [math]\displaystyle{ a, b \in \mathbf{R}^n }[/math] and want a vector [math]\displaystyle{ v \in \mathbf{R}^n }[/math] orthogonal to both. That means solving two linear equations—[math]\displaystyle{ \langle a, v \rangle = 0 }[/math] and [math]\displaystyle{ \langle b, v \rangle = 0 }[/math]—in [math]\displaystyle{ n }[/math] unknowns, leaving [math]\displaystyle{ n - 2 }[/math] free parameters:

  • In [math]\displaystyle{ \mathbf{R}^2 }[/math] ([math]\displaystyle{ n = 2 }[/math]): [math]\displaystyle{ 2 - 2 = 0 }[/math] free parameters. Only the zero vector is orthogonal to both [math]\displaystyle{ a }[/math] and [math]\displaystyle{ b }[/math].
  • In [math]\displaystyle{ \mathbf{R}^3 }[/math] ([math]\displaystyle{ n = 3 }[/math]): [math]\displaystyle{ 3 - 2 = 1 }[/math] free parameter. All orthogonal vectors lie along a single line, so specifying magnitude and the right-hand rule picks out a unique vector.
  • In [math]\displaystyle{ \mathbf{R}^4 }[/math] ([math]\displaystyle{ n = 4 }[/math]): [math]\displaystyle{ 4 - 2 = 2 }[/math] free parameters—an entire 2D plane of orthogonal vectors. For example, both [math]\displaystyle{ (0, 0, 1, 0) }[/math] and [math]\displaystyle{ (0, 0, 0, 1) }[/math] (and every linear combination of them) are perpendicular to [math]\displaystyle{ (1, 0, 0, 0) }[/math] and [math]\displaystyle{ (0, 1, 0, 0) }[/math], so "perpendicular to both" no longer specifies a single direction.

Physics uses the cross product to describe rotations and oriented planes (such as the plane of a spinning wheel or a current loop). Every rotation takes place in a 2D plane, not inherently around a line:

  • In 2D, there is only [math]\displaystyle{ \binom{2}{2} = 1 }[/math] coordinate plane ([math]\displaystyle{ xy }[/math]), so rotation is just a single signed scalar (clockwise or counterclockwise).
  • In 3D, there are [math]\displaystyle{ \binom{3}{2} = 3 }[/math] coordinate planes ([math]\displaystyle{ yz, zx, xy }[/math])—which happens to equal the [math]\displaystyle{ 3 }[/math] coordinate axes ([math]\displaystyle{ x, y, z }[/math]). This coincidence lets us pair each plane of rotation with its unique normal axis and package torque, angular momentum, and magnetic fields as 3D vectors.
  • In 4D, there are [math]\displaystyle{ \binom{4}{2} = 6 }[/math] independent coordinate planes ([math]\displaystyle{ xy, xz, xw, yz, yw, zw }[/math]), which cannot be stored in a 4-component vector. That is why in 4D relativity, angular momentum and the electromagnetic field are represented as [math]\displaystyle{ 4 \times 4 }[/math] antisymmetric matrices (which have [math]\displaystyle{ 6 }[/math] independent entries—one per coordinate plane) rather than 4-vectors.

The signed-volume construction [math]\displaystyle{ \langle c, v \rangle = \det(v, v_1, \dots, v_{n-1}) }[/math] generalizes cleanly to any dimension [math]\displaystyle{ n }[/math] if you supply [math]\displaystyle{ n - 1 }[/math] vectors instead of [math]\displaystyle{ 2 }[/math] (leaving [math]\displaystyle{ n - (n - 1) = 1 }[/math] perpendicular axis). In 2D, it takes [math]\displaystyle{ 1 }[/math] vector [math]\displaystyle{ (a_x, a_y) }[/math] and returns [math]\displaystyle{ (-a_y, a_x) }[/math] (a [math]\displaystyle{ 90^\circ }[/math] counterclockwise rotation); in 3D, it takes [math]\displaystyle{ 2 }[/math] vectors (the standard cross product); in 4D, it takes [math]\displaystyle{ 3 }[/math] vectors to determine a single perpendicular vector.

Finally, what if we relax the requirement that orthogonality alone determine a unique line, and simply ask for any bilinear product of two vectors in [math]\displaystyle{ \mathbf{R}^n }[/math] ([math]\displaystyle{ n \ge 2 }[/math]) that is orthogonal to both inputs and has norm equal to the parallelogram area ([math]\displaystyle{ \|a \times b\|^2 = \|a\|^2\|b\|^2 - \langle a, b \rangle^2 }[/math])? Remarkably, such a cross product exists only in [math]\displaystyle{ n = 3 }[/math] and [math]\displaystyle{ n = 7 }[/math]. In [math]\displaystyle{ \mathbf{R}^7 }[/math], the space orthogonal to two non-parallel vectors is [math]\displaystyle{ 7 - 2 = 5 }[/math]-dimensional, so orthogonality does not select a direction; instead, a 7D cross product picks out a specific perpendicular vector using the multiplication table of the 8-dimensional octonions (just as the 3D cross product comes from the 4-dimensional quaternions). Because that choice depends on the octonion multiplication rule, the 7D cross product is not unique up to sign, is not preserved by all 7D rotations, and loses the general vector triple product identity (since octonion multiplication is non-associative).

Vector Product Identities

When combining dot products and cross products in [math]\displaystyle{ \mathbf{R}^3 }[/math], two identities are particularly useful:

  1. Orthogonality: [math]\displaystyle{ (\vec{w} \times \vec{v}) \cdot \vec{v} = 0 }[/math] and [math]\displaystyle{ (\vec{w} \times \vec{v}) \cdot \vec{w} = 0 }[/math]. Because [math]\displaystyle{ \vec{w} \times \vec{v} }[/math] is orthogonal to both [math]\displaystyle{ \vec{w} }[/math] and [math]\displaystyle{ \vec{v} }[/math], its dot product with either vanishes.
  2. Scalar Triple Product: [math]\displaystyle{ \vec{a} \cdot (\vec{b} \times \vec{c}) = (\vec{a} \times \vec{b}) \cdot \vec{c} = \vec{b} \cdot (\vec{c} \times \vec{a}) }[/math]. This scalar equals the determinant of the [math]\displaystyle{ 3 \times 3 }[/math] matrix whose rows (or columns) are [math]\displaystyle{ \vec{a}, \vec{b}, \vec{c} }[/math], and its absolute value equals the volume of the parallelepiped spanned by the vectors. Cyclic permutations of these vectors preserve the volume and swapping any two vectors flips the sign.

Representations of a Vector

A physical vector or an element of an abstract vector space [math]\displaystyle{ V }[/math] exists independently of any coordinate system. Once an ordered basis is chosen, it establishes a one-to-one correspondence (isomorphism [math]\displaystyle{ V \cong \mathbf{R}^n }[/math]) that assigns each vector a unique list of coordinates. Depending on the problem, we choose whichever representation is most convenient; all carry identical information.

Magnitude and Direction Form

In this form, we specify:

  • The norm (magnitude) [math]\displaystyle{ \|\vec{a}\| }[/math], and
  • The orientation (an angle, cardinal direction, or axis).

For example, "a [math]\displaystyle{ 5\ \text{m} }[/math] displacement at [math]\displaystyle{ 36.9^\circ }[/math] above the horizontal" is in this form. This form is intuitive and often used in word problems and real-life descriptions.

Component Form

Once a basis is decided, we break the vector into components along the coordinate axes. In [math]\displaystyle{ \mathbf{R}^3 }[/math]:

[math]\displaystyle{ \vec{a} = (a_x, a_y, a_z) }[/math]

For example, [math]\displaystyle{ (4, 3, 0) }[/math] means the vector extends 2 units along [math]\displaystyle{ +x }[/math], 0 along [math]\displaystyle{ y }[/math], and 3 along [math]\displaystyle{ -z }[/math]. Most algebraic operations are done using component form. Computers also typically store vectors this way (at least in the abstract sense).

Unit Vector Form

Using the standard orthonormal basis [math]\displaystyle{ \hat{i}, \hat{j}, \hat{k} }[/math] (or alternatively written as [math]\displaystyle{ \hat{x}, \hat{y}, \hat{z} }[/math]) of [math]\displaystyle{ \mathbf{R}^3 }[/math], every vector is written uniquely as a linear combination:

[math]\displaystyle{ \vec{a} = a_x \hat{i} + a_y \hat{j} + a_z \hat{k} }[/math]

For example, [math]\displaystyle{ (4, 3, 0) = 4\hat{i} + 3\hat{j} }[/math]. Unit vector form and component form carry identical numerical information; basis form makes the underlying linear combination explicit, which can be useful when working in other bases.

In [math]\displaystyle{ n }[/math] dimensions, specifying a vector always requires [math]\displaystyle{ n }[/math] numbers in the field (which in introductory physics is almost always the real numbers), regardless of the representation. In [math]\displaystyle{ \mathbf{R}^3 }[/math], Cartesian component form uses [math]\displaystyle{ 3 }[/math] coordinates [math]\displaystyle{ (a_x, a_y, a_z) }[/math], while spherical magnitude–direction form uses [math]\displaystyle{ 1 }[/math] norm and [math]\displaystyle{ 2 }[/math] angles [math]\displaystyle{ (\|\vec{a}\|, \theta, \phi) }[/math].

Converting Between Forms

In [math]\displaystyle{ \mathbf{R}^2 }[/math], we convert between Cartesian components [math]\displaystyle{ (a_x, a_y) }[/math] and polar magnitude–direction form [math]\displaystyle{ (\|\vec{a}\|, \phi) }[/math] with [math]\displaystyle{ \phi \in (-\pi, \pi] }[/math] using the inner product and right-triangle trigonometry:

  • Components to magnitude and direction:
[math]\displaystyle{ \|\vec{a}\| = \sqrt{\langle \vec{a}, \vec{a} \rangle} = \sqrt{a_x^2 + a_y^2} }[/math]
[math]\displaystyle{ \phi = \begin{cases} \arctan\!\left(\frac{a_y}{a_x}\right) & \text{if } a_x \gt 0, \\ \arctan\!\left(\frac{a_y}{a_x}\right) + \pi & \text{if } a_x \lt 0 \text{ and } a_y \ge 0, \\ \arctan\!\left(\frac{a_y}{a_x}\right) - \pi & \text{if } a_x \lt 0 \text{ and } a_y \lt 0, \\ \frac{\pi}{2} & \text{if } a_x = 0 \text{ and } a_y \gt 0, \\ -\frac{\pi}{2} & \text{if } a_x = 0 \text{ and } a_y \lt 0. \end{cases} }[/math]
(For [math]\displaystyle{ \vec{a} = (0, 0) }[/math], [math]\displaystyle{ \phi }[/math] is undefined. This piecewise formula is equivalent to the two-argument function [math]\displaystyle{ \operatorname{atan2}(a_y, a_x) }[/math] used in computing; to express [math]\displaystyle{ \phi }[/math] in [math]\displaystyle{ [0, 2\pi) }[/math] instead, add [math]\displaystyle{ 2\pi }[/math] whenever [math]\displaystyle{ \phi \lt 0 }[/math].)
  • Magnitude and direction to components (via inner product projections onto the orthonormal basis [math]\displaystyle{ \hat{x}, \hat{y} }[/math]):
[math]\displaystyle{ a_x = \langle \vec{a}, \hat{x} \rangle = \|\vec{a}\|\cos\phi }[/math]
[math]\displaystyle{ a_y = \langle \vec{a}, \hat{y} \rangle = \|\vec{a}\|\sin\phi }[/math]

Vectors in VPython

In VPython (used in GlowScript), vectors are represented by the type vec or vector. The constructor takes three arguments: the x, y, and z components:

velocity = vec(3, -1, 2)

This creates a vector called velocity with coordinates [math]\displaystyle{ (3, -1, 2) }[/math]. (Note that when printed to the console, VPython displays vectors using angle brackets, e.g., <3, -1, 2>, following introductory physics convention rather than inner-product notation.)

In VPython's default view, [math]\displaystyle{ +x }[/math] points right, [math]\displaystyle{ +y }[/math] points upward, and [math]\displaystyle{ +z }[/math] points out of the screen toward the viewer.

Modifying Vectors

Individual components can be accessed or updated with .x, .y, and .z:

velocity.x = 5  # changes velocity from (3, -1, 2) to (5, -1, 2)

Helpful Vector Functions

Magnitude

VPython provides the mag function to compute the magnitude (Euclidean norm) of a vector:

velocity = vec(3, -1, 2)
speed = mag(velocity)  # magnitude of velocity

Normalize

To obtain a unit vector in the same direction (normalize a vector), use norm:

v = vec(5, 0, 0)
v_hat = norm(v)  # unit vector (1, 0, 0)


Dot and Cross Product

The functions dot and cross compute dot and cross products:

a = vec(1, 2, 3)
b = vec(4, 5, 6)
dot_prod = dot(a, b)      # <a, b> = a · b
cross_prod = cross(a, b)  # a × b

Visualization

To visualize vectors, VPython provides the arrow object, specified by:

  • pos – tail position,
  • axis – direction and length of the arrow (a vector).

Optional attributes include shaftwidth, headwidth, headlength, and color (see the VPython arrow documentation).

velocity = vec(1, 1, 0)
origin = vec(0, 0, 0)
shaftwidth = 0.1
vel_arrow = arrow(pos=origin, axis=velocity,
                  shaftwidth=shaftwidth, color=color.red)

Output in VPython of a visualized vector

A Computational Model

Click here to run the interactive GlowScript computational model.

This model walks through basic vector operations step by step. It starts by defining vectors as arrows, then explores:

  • Addition and subtraction
  • Scalar multiplication
  • Magnitude and unit vectors
  • Dot and cross products

Each operation is shown both in formula form and using VPython shortcut functions. You can edit the vector values and rerun the code to see how the results change. Commenting out parts of the script can help you focus on one type of operation at a time.

Exercises and Solutions

Very Simple

Given the vector [math]\displaystyle{ \vec{a} = (2.5, 7.4, 8.0) }[/math], find its norm (magnitude) and a unit vector in its direction.

Solution

First, compute the Euclidean norm:

[math]\displaystyle{ \|\vec{a}\| = \sqrt{2.5^2 + 7.4^2 + 8.0^2} = \sqrt{6.25 + 54.76 + 64} = \sqrt{125.01} \approx 11.18. }[/math]

[math]\displaystyle{ \hat{a} = \frac{1}{\|\vec{a}\|}\vec{a} = \left(\frac{2.5}{\sqrt{125.01}},\; \frac{7.4}{\sqrt{125.01}},\; \frac{8.0}{\sqrt{125.01}}\right) \approx (0.224,\; 0.662,\; 0.716). }[/math]

Then the norm is about [math]\displaystyle{ 11.18 }[/math], and the unit vector in its direction is [math]\displaystyle{ (0.224, 0.662, 0.716) }[/math].

Simple

Let [math]\displaystyle{ \vec{a} = (2, 4, 2) }[/math] and [math]\displaystyle{ \vec{b} = (-1, 1, 3) }[/math]. Find the norm of [math]\displaystyle{ \vec{a} - 2\vec{b} }[/math].

Solution

Compute the combination coordinate-wise:

[math]\displaystyle{ \vec{a} - 2\vec{b} = (2, 4, 2) - 2(-1, 1, 3) = (2, 4, 2) - (-2, 2, 6) = (4, 2, -4). }[/math]

Now find its norm:

[math]\displaystyle{ \|(4, 2, -4)\| = \sqrt{4^2 + 2^2 + (-4)^2} = \sqrt{16 + 4 + 16} = \sqrt{36} = 6. }[/math]

Simple

Find the angle [math]\displaystyle{ \theta \in [0, \pi] }[/math] between [math]\displaystyle{ \vec{a} = (2, 5, -2) }[/math] and [math]\displaystyle{ \vec{b} = (3, -4, -1) }[/math].

Solution

From the inner product angle formula:

[math]\displaystyle{ \langle \vec{a}, \vec{b} \rangle = \|\vec{a}\|\|\vec{b}\|\cos\theta \implies \theta = \arccos\!\left(\frac{\langle \vec{a}, \vec{b} \rangle}{\|\vec{a}\|\|\vec{b}\|}\right). }[/math]

Compute the inner product:

[math]\displaystyle{ \langle \vec{a}, \vec{b} \rangle = 2(3) + 5(-4) + (-2)(-1) = 6 - 20 + 2 = -12. }[/math]

Compute the norms:

[math]\displaystyle{ \|\vec{a}\| = \sqrt{2^2 + 5^2 + (-2)^2} = \sqrt{4 + 25 + 4} = \sqrt{33}, }[/math]

[math]\displaystyle{ \|\vec{b}\| = \sqrt{3^2 + (-4)^2 + (-1)^2} = \sqrt{9 + 16 + 1} = \sqrt{26}. }[/math]

Finally,

[math]\displaystyle{ \theta = \arccos\!\left(\frac{-12}{\sqrt{33}\sqrt{26}}\right) = \arccos\!\left(\frac{-12}{\sqrt{858}}\right) \approx 114.2^\circ. }[/math]


Intermediate

An airplane is flying in still air at [math]\displaystyle{ 240\ \text{m/s} }[/math], [math]\displaystyle{ 35^\circ }[/math] south of west. A wind begins blowing at [math]\displaystyle{ 80\ \text{m/s} }[/math], [math]\displaystyle{ 15^\circ }[/math] east of north. What must the plane’s new velocity relative to the air be in order to keep the same overall trajectory? Give your answer in components with [math]\displaystyle{ +x }[/math] east and [math]\displaystyle{ +y }[/math] north.

Solution

Let:

  • [math]\displaystyle{ \vec{v}_{p,0} }[/math] = original velocity of the plane (relative to air),
  • [math]\displaystyle{ \vec{v}_w }[/math] = wind velocity (relative to ground),
  • [math]\displaystyle{ \vec{v}_{p,1} }[/math] = new velocity of the plane relative to the air.

With the wind blowing, the plane's velocity relative to the ground is [math]\displaystyle{ \vec{v}_{p,1} + \vec{v}_w }[/math]. Requiring this resultant ground velocity to remain equal to [math]\displaystyle{ \vec{v}_{p,0} }[/math] gives:

[math]\displaystyle{ \vec{v}_{p,1} + \vec{v}_w = \vec{v}_{p,0} \implies \vec{v}_{p,1} = \vec{v}_{p,0} - \vec{v}_w. }[/math]

Express everything in components ([math]\displaystyle{ +x }[/math] east, [math]\displaystyle{ +y }[/math] north):

  • [math]\displaystyle{ 35^\circ }[/math] south of west corresponds to [math]\displaystyle{ \phi = 180^\circ + 35^\circ = 215^\circ }[/math] from the [math]\displaystyle{ +x }[/math]-axis:
[math]\displaystyle{ \vec{v}_{p,0} = (240\cos 215^\circ,\; 240\sin 215^\circ)\ \text{m/s} \approx (-196.60,\; -137.66)\ \text{m/s}. }[/math]
  • [math]\displaystyle{ 15^\circ }[/math] east of north corresponds to [math]\displaystyle{ \phi = 90^\circ - 15^\circ = 75^\circ }[/math] from the [math]\displaystyle{ +x }[/math]-axis:
[math]\displaystyle{ \vec{v}_w = (80\cos 75^\circ,\; 80\sin 75^\circ)\ \text{m/s} \approx (20.71,\; 77.27)\ \text{m/s}. }[/math]

Subtract component-wise:

[math]\displaystyle{ \vec{v}_{p,1} = \vec{v}_{p,0} - \vec{v}_w \approx (-196.60,\; -137.66) - (20.71,\; 77.27) \approx (-217.3,\; -214.9)\ \text{m/s}. }[/math]

The plane must adjust its velocity relative to the air to approximately [math]\displaystyle{ (-217.3, -214.9)\ \text{m/s} }[/math] to maintain its original ground velocity.

Intermediate

A mechanic applies a force [math]\displaystyle{ \vec{F} = (30,\; 20,\; -20)\ \text{N} }[/math] to the end of a lever whose position vector relative to the pivot is [math]\displaystyle{ \vec{r} = (0.3,\; -0.4,\; 0.1)\ \text{m} }[/math].

  1. Compute the torque vector [math]\displaystyle{ \vec{\tau} = \vec{r} \times \vec{F} }[/math] about the pivot.
  2. Find the magnitude [math]\displaystyle{ \|\vec{\tau}\| }[/math] of the torque.
  3. Verify using inner products that [math]\displaystyle{ \vec{\tau} }[/math] is orthogonal to both [math]\displaystyle{ \vec{r} }[/math] and [math]\displaystyle{ \vec{F} }[/math], and state what vector you would obtain if you mistakenly computed [math]\displaystyle{ \vec{F} \times \vec{r} }[/math] instead.

Solution

1. Compute [math]\displaystyle{ \vec{\tau} = \vec{r} \times \vec{F} }[/math]:

Using the determinant form (or component formula) with [math]\displaystyle{ \vec{r} = (0.3, -0.4, 0.1)\ \text{m} }[/math] and [math]\displaystyle{ \vec{F} = (30, 20, -20)\ \text{N} }[/math]:

[math]\displaystyle{ \vec{\tau} = \begin{vmatrix} \hat{i} & \hat{j} & \hat{k} \\ 0.3 & -0.4 & 0.1 \\ 30 & 20 & -20 \end{vmatrix}\ \text{N}\cdot\text{m} }[/math]

Expand component by component (keeping track of the minus sign on the [math]\displaystyle{ \hat{j} }[/math] term):

  • [math]\displaystyle{ \tau_x = (-0.4)(-20) - (0.1)(20) = 8 - 2 = 6\ \text{N}\cdot\text{m} }[/math]
  • [math]\displaystyle{ \tau_y = -\big[(0.3)(-20) - (0.1)(30)\big] = -(-6 - 3) = 9\ \text{N}\cdot\text{m} }[/math]
  • [math]\displaystyle{ \tau_z = (0.3)(20) - (-0.4)(30) = 6 - (-12) = 18\ \text{N}\cdot\text{m} }[/math]

Thus,

[math]\displaystyle{ \vec{\tau} = (6,\; 9,\; 18)\ \text{N}\cdot\text{m}. }[/math]

(Note: Although [math]\displaystyle{ \text{N}\cdot\text{m} }[/math] has the same SI base units as the joule, torque is conventionally written in [math]\displaystyle{ \text{N}\cdot\text{m} }[/math] to distinguish it from energy or work.)

2. Find the magnitude [math]\displaystyle{ \|\vec{\tau}\| }[/math]:

[math]\displaystyle{ \|\vec{\tau}\| = \sqrt{6^2 + 9^2 + 18^2}\ \text{N}\cdot\text{m} = \sqrt{36 + 81 + 324}\ \text{N}\cdot\text{m} = \sqrt{441}\ \text{N}\cdot\text{m} = 21\ \text{N}\cdot\text{m}. }[/math]

3. Verify orthogonality and anticommutativity:

Compute the inner product of [math]\displaystyle{ \vec{\tau} }[/math] with [math]\displaystyle{ \vec{r} }[/math] and with [math]\displaystyle{ \vec{F} }[/math]:

[math]\displaystyle{ \langle \vec{\tau}, \vec{r} \rangle = 6(0.3) + 9(-0.4) + 18(0.1) = 1.8 - 3.6 + 1.8 = 0, }[/math]

[math]\displaystyle{ \langle \vec{\tau}, \vec{F} \rangle = 6(30) + 9(20) + 18(-20) = 180 + 180 - 360 = 0. }[/math]

Since both inner products vanish, [math]\displaystyle{ \vec{\tau} }[/math] is orthogonal to both [math]\displaystyle{ \vec{r} }[/math] and [math]\displaystyle{ \vec{F} }[/math].

Finally, because the cross product is anticommutative ([math]\displaystyle{ \vec{F} \times \vec{r} = -(\vec{r} \times \vec{F}) }[/math]), reversing the order flips every sign:

[math]\displaystyle{ \vec{F} \times \vec{r} = -\vec{\tau} = (-6,\; -9,\; -18)\ \text{N}\cdot\text{m}. }[/math]

Challenging

Suppose [math]\displaystyle{ \vec{u} }[/math] and [math]\displaystyle{ \vec{v} }[/math] are two vectors in [math]\displaystyle{ \mathbf{R}^3 }[/math] (or more generally [math]\displaystyle{ \mathbf{R}^n }[/math]) such that

[math]\displaystyle{ \|\vec{u}\| = 3, \qquad \|\vec{u} + \vec{v}\| = 4, \qquad \|\vec{u} - \vec{v}\| = 6. }[/math]

Without knowing any components of [math]\displaystyle{ \vec{u} }[/math] or [math]\displaystyle{ \vec{v} }[/math], find the norm [math]\displaystyle{ \|\vec{v}\| }[/math] and the angle [math]\displaystyle{ \theta }[/math] between [math]\displaystyle{ \vec{u} }[/math] and [math]\displaystyle{ \vec{v} }[/math].

Solution

Recall that the square of a vector's norm equals the inner product of the vector with itself: [math]\displaystyle{ \|x\|^2 = \langle x, x \rangle }[/math]. Expanding the squared norms of the sum and difference using the linearity and symmetry of the real inner product gives:

[math]\displaystyle{ \|\vec{u} + \vec{v}\|^2 = \langle \vec{u} + \vec{v},\; \vec{u} + \vec{v} \rangle = \|\vec{u}\|^2 + 2\langle \vec{u}, \vec{v} \rangle + \|\vec{v}\|^2 }[/math]

[math]\displaystyle{ \|\vec{u} - \vec{v}\|^2 = \langle \vec{u} - \vec{v},\; \vec{u} - \vec{v} \rangle = \|\vec{u}\|^2 - 2\langle \vec{u}, \vec{v} \rangle + \|\vec{v}\|^2 }[/math]

1. Find [math]\displaystyle{ \|\vec{v}\| }[/math] (Parallelogram Equality):

Adding the two equations cancels the [math]\displaystyle{ 2\langle \vec{u}, \vec{v} \rangle }[/math] cross-term:

[math]\displaystyle{ \|\vec{u} + \vec{v}\|^2 + \|\vec{u} - \vec{v}\|^2 = 2\left(\|\vec{u}\|^2 + \|\vec{v}\|^2\right) }[/math]

Substitute the given norms ([math]\displaystyle{ \|\vec{u}\| = 3 }[/math], [math]\displaystyle{ \|\vec{u} + \vec{v}\| = 4 }[/math], [math]\displaystyle{ \|\vec{u} - \vec{v}\| = 6 }[/math]):

[math]\displaystyle{ 4^2 + 6^2 = 2\left(3^2 + \|\vec{v}\|^2\right) }[/math]

[math]\displaystyle{ 16 + 36 = 2\left(9 + \|\vec{v}\|^2\right) }[/math]

[math]\displaystyle{ 52 = 18 + 2\|\vec{v}\|^2 \implies 2\|\vec{v}\|^2 = 34 \implies \|\vec{v}\|^2 = 17 }[/math]

Since a norm is always nonnegative:

[math]\displaystyle{ \|\vec{v}\| = \sqrt{17} \approx 4.12. }[/math]

2. Find the angle [math]\displaystyle{ \theta }[/math] between [math]\displaystyle{ \vec{u} }[/math] and [math]\displaystyle{ \vec{v} }[/math]:

Subtracting the second expansion from the first isolates the inner product:

[math]\displaystyle{ \|\vec{u} + \vec{v}\|^2 - \|\vec{u} - \vec{v}\|^2 = 4\langle \vec{u}, \vec{v} \rangle }[/math]

[math]\displaystyle{ 16 - 36 = 4\langle \vec{u}, \vec{v} \rangle \implies \langle \vec{u}, \vec{v} \rangle = -5 }[/math]

Applying the inner product angle formula:

[math]\displaystyle{ \cos\theta = \frac{\langle \vec{u}, \vec{v} \rangle}{\|\vec{u}\|\|\vec{v}\|} = \frac{-5}{3\sqrt{17}} \approx -0.4042 }[/math]

[math]\displaystyle{ \theta = \arccos\!\left(\frac{-5}{3\sqrt{17}}\right) \approx 113.8^\circ. }[/math]

Geometric & physics note: Think of [math]\displaystyle{ \vec{u} }[/math] and [math]\displaystyle{ \vec{v} }[/math] as two adjacent sides of a parallelogram (for example, two forces acting on a particle); then [math]\displaystyle{ \vec{u} + \vec{v} }[/math] and [math]\displaystyle{ \vec{u} - \vec{v} }[/math] are its two diagonals. The identity [math]\displaystyle{ \|\vec{u} + \vec{v}\|^2 + \|\vec{u} - \vec{v}\|^2 = 2(\|\vec{u}\|^2 + \|\vec{v}\|^2) }[/math] is the parallelogram equality, which allows us to recover unknown norms and angles purely from length measurements—without ever choosing a coordinate system.

Applications and History

Applications Across Disciplines

Vectors appear in many everyday and engineering contexts.

Consider a desk. Its weight is a force vector pointing downward, the normal force from the floor is a vector pointing upward, and the forces among the desk’s parts can all be represented as vectors. Measurements such as the diagonal distance across the desktop can also be seen as vectors from one corner to another.

Your motion can be described using vectors as well. Your position relative to some reference point can be written as a position vector. The difference between two position vectors is a displacement vector. Velocity describes how your position changes over time; it is the time derivative of the position vector, and its magnitude is your speed. Acceleration is the time derivative of velocity. All of these quantities can be broken into components, which makes it easier to analyze motion in each direction separately.

Vectors and units appear across everyday physical situations and virtually every STEM field:

  • Electromagnetism and Fields: Electric fields [math]\displaystyle{ \vec{E} }[/math] and magnetic fields [math]\displaystyle{ \vec{B} }[/math] are vector fields that assign a vector to every point in space, interacting with charges through operations like the Lorentz force [math]\displaystyle{ \vec{F} = q(\vec{E} + \vec{v} \times \vec{B}) }[/math].
  • Engineering: Structural stress analysis, fluid dynamics, robotics kinematics, control theory, and phasor analysis in AC electrical circuits all depend on vector spaces and inner products.
  • Computer Science and Graphics: 2D/3D rendering engines use vectors for positions, surface normals, lighting (via dot products), and coordinate transformations, while machine learning models represent data points as vectors in high-dimensional spaces [math]\displaystyle{ \mathbf{R}^n }[/math].
  • Navigation: GPS receivers, aircraft, and ships continuously combine position, velocity, wind, and current vectors to compute headings and trajectories.

History

Ideas similar to vectors go back many centuries. Early uses treated them as directed line segments rather than abstract quantities. Hero of Alexandria’s work Mechanics in the first century AD contains one of the earliest known discussions of adding such directed segments.

In the 18th and 19th centuries, several mathematicians used 2D vectors to represent complex numbers. Caspar Wessel, Jean-Robert Argand, Carl Friedrich Gauss, and William Rowan Hamilton all contributed to this viewpoint. One component represented the real part, and the other represented the imaginary part. Hamilton also introduced the term “vector.”

August Ferdinand Möbius, in his 1827 book The Barycentric Calculus, formalized many vector ideas, including labeling vectors with letters and defining scalar multiplication. Hermann Grassmann, in his 1844 work Ausdehnungslehre (“The Calculus of Extension”), developed a more general theory of vectors in spaces of arbitrary dimension and laid foundations for linear algebra.

The modern vector notation and conventions used in physics owe a lot to J. Willard Gibbs and Oliver Heaviside in the late 19th century. They refined vector methods and used them to express Maxwell’s equations of electromagnetism in the compact form we study today.

See Also

External Links

Further Reading

  • Linear Algebra Done Right – Sheldon Axler (2024)
  • Vector Analysis – Josiah Willard Gibbs & Edwin Bidwell Wilson (1901)
  • Introduction to Matrices and Vectors – Jacob T. Schwartz (1961)

References