Vectors: Difference between revisions

From Physics Book
Jump to navigation Jump to search
Fixed a slight discrepancy in the component form explanation.
 
(41 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''John Yang -- Fall 2026'''


== Claimed by: ==
==Introduction==
'''Anushka Dogra (Fall 2022)'''
Additional edits by '''Sally Smith (Fall 2023)'''
Additional edits by '''Shiv Patel (Spring 2024)'''


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.


==Vectors and Units==
[[File:wikivector.png]]


Vectors and units are fundamental concepts in mathematics and physics, playing a crucial role in describing quantities with both magnitude and direction. Understanding vectors and units is essential for various fields, including physics, engineering, and computer science.
===Notation Conventions===


Image
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:


https://labs.phys.utk.edu/mbreinig/phys221core/modules/m1/images/Image3.gif
{| 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>)
|}


==Overview==
'''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.
Vectors are mathematical objects represented by directed line segments, characterized by both magnitude and direction. They are often denoted by boldface letters or arrows, such as v or ⟶AB. Vectors can represent various physical quantities, including displacement, velocity, force, and acceleration.


Units, on the other hand, are standards used to quantify and measure physical quantities. They provide a reference for expressing magnitudes and enable meaningful comparisons between measurements. Common units include meters (m) for length, kilograms (kg) for mass, seconds (s) for time, and newtons (N) for force.
===Physical Examples and Visual Representation===


====Position and Displacement====


https://www.onlinemathlearning.com/image-files/unit-vector.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
==Magnitude==
The magnitude of a vector represents its length or size and is denoted by |v|. It is a scalar quantity and is always non-negative. The magnitude of a vector is calculated using the Pythagorean theorem in two or three dimensions.


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


https://www.wikihow.com/images/thumb/0/02/Find-Unit-Vector-Step-3-Version-2.jpg/v4-460px-Find-Unit-Vector-Step-3-Version-2.jpg
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.
==Direction==
The direction of a vector indicates its orientation in space and is often described relative to a reference axis or another vector. It can be expressed using angles, unit vectors, or geometric descriptions.


==Addition and Subtraction==
====Velocity====
Vectors can be added or subtracted to form new vectors using the parallelogram rule or the head-to-tail method. In component form, vector addition involves adding corresponding components separately.


https://www.wikihow.com/images/thumb/b/b0/Add-or-Subtract-Vectors-Step-3-Version-2.jpg/v4-460px-Add-or-Subtract-Vectors-Step-3-Version-2.jpg
'''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>\vec{v}(t) = \frac{d\vec{r}}{dt}</math>


==Scalar Multiplication==
For example, if <math>\vec{r}(t) = (t, 1, 0)\ \text{m}</math>, then:
Scalar multiplication involves multiplying a vector by a scalar quantity, resulting in a new vector with the same direction but a modified magnitude. It is a fundamental operation in vector algebra and has applications in scaling and resizing vectors.


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


https://i.ytimg.com/vi/0LYOSzRuNeI/hqdefault.jpg
The speed is the norm <math>\|\vec{v}(t)\| = \sqrt{1^2 + 0^2 + 0^2} = 1\ \text{m/s}</math>.


==Dot Product==
[[File:Velwiki.png]]
The dot product (or scalar product) of two vectors yields a scalar quantity equal to the product of their magnitudes and the cosine of the angle between them. It is used to calculate the angle between vectors, project one vector onto another, and determine the work done by a force.


https://study.com/cimages/multimages/16/dotproducteq2.jpg
====Weight====


==Cross Product==
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,
The cross product (or vector product) of two vectors yields a new vector that is perpendicular to the plane containing the original vectors. Its magnitude is equal to the product of the magnitudes of the original vectors and the sine of the angle between them. The cross product is used to find torque, angular momentum, and determine the direction of a resultant force in rotational motion.


<math>\vec{F}_g = (0, -mg, 0)</math>


https://i.ytimg.com/vi/yLug2TnnyI4/maxresdefault.jpg
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.


====Visualizing Vectors====


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 2 vectors A and B, the cross product is |A|x|B| sin(theta) where theta is the angle between them. The direction of this vector can be given by the right hand rule.  
The example below shows a velocity vector for a ball moving to the right at 5 m/s.


Cross Product properties:
[[File:Vectorvisualrepresentation.png]]
- The cross product does NOT commute. A x B does NOT equal B x A
- The cross product distributes over addition A x (B + C) = (A x B) + (A x C)
- The cross product of a vector with itself is 0. This is because the angle between a vector and itself if 0, and sin (0) = 0


==Units of Measurement==
==Units and Measurement==
==SI Units==
The International System of Units (SI) is the most widely used system of measurement, adopted by most countries worldwide. It defines seven base units from which all other units are derived, including the meter (m) for length, kilogram (kg) for mass, second (s) for time, ampere (A) for electric current, kelvin (K) for temperature, mole (mol) for amount of substance, and candela (cd) for luminous intensity.


==Derived Units==
===SI Base Units===
Derived units are formed by combining base units according to mathematical relationships. Examples include the newton (N) for force (kg·m/s^2), the joule (J) for energy (N·m), and the watt (W) for power (J/s). These units are essential for expressing complex physical quantities.


==Conversion==
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:
Conversion between units involves transforming measurements from one unit to another while preserving their numerical value. It is often necessary when working with data from different sources or when communicating results to audiences using different unit systems.


==Applications==
* '''meter''' (<math>\text{m}</math>) – length
Vectors and units have diverse applications across various disciplines:
* '''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


*Physics: Vectors are used to describe the motion of objects, forces acting on bodies, and electromagnetic fields.
All vector quantities in introductory physics carry combinations of these base units.


*Engineering: Vectors are employed in structural analysis, fluid mechanics, and electrical circuit design.
===Derived Units===


*Computer Graphics: Vectors are utilized to represent geometric shapes, positions of objects, and transformations in 2D and 3D graphics.
'''Derived units''' are formed by combining SI base units through multiplication and division. Common examples include:


*Navigation: Vectors are used in GPS systems to determine position, velocity, and direction for navigation purposes.
* '''newton''' (<math>\text{N} = \text{kg}\cdot\text{m/s}^2</math>) – force
* '''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


==Conclusion==
===Unit Conversion and Dimensional Consistency===
Understanding vectors and units is essential for comprehending and analyzing physical phenomena and mathematical relationships in various fields. By mastering these concepts, researchers, engineers, and scientists can effectively model, predict, and manipulate quantities in the real world.


'''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>\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'''.


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>.


(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>


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).


_________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
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.


==What is a Vector?==
===Inner Products and Norms===


In mathematics and physics, a vector is a quantity with a magnitude and a direction in space.
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).


The general syntax of a vector follows a letter with an arrow above it equaling a set of coordinates in a 1st, 2nd, 3rd or more dimension coordinate system.
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:
Looking at the following vector <math><v_x, v_y, v_z> </math>,  
<math>v_x </math> says the x-component of the vector, <math>v_y </math> says the y-component of the vector, and <math>v_z </math> says the z-component of the vector.
Alternatively, a vector can be written as a boldface letter: <b>a</b>. Which letter is used depends on the problem and desired quantity; for example, <math>\vec{v}</math> represents velocity.
A specific component of a vector, see the section titled "forms", is denoted by a subscript: c<sub>x</sub>. For example, q<sub>y</sub> represents the y component of a vector <math>\vec{q}</math>.


====Example of a Simple Vector====
<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>


<math> \vec{v} = <1, 0, 0> </math>
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:


This vector is denoted by the letter v. It is in a 3-dimensional coordinate system and its direction is in the positive-x direction with a magnitude of 1.
<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>


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


The magnitude of a vector is the length of a vector.
<math>\|v\| = \sqrt{v_x^2 + v_y^2 + v_z^2}</math>


Surrounding a vector by | | symbols denotes a vector's magnitude: <math>|\vec{v}|</math>. Alternatively, there exists the notation <math>\overline{v}</math> and <math>\lVert \vec{v} \rVert_2</math>, with the latter denoting the Euclidean norm. This is the type of vector norm that you will see most often.
====Unit Vectors====


Most commonly used in this class, in a three dimensional system, the magnitude of some vector <math><v_x, v_y, v_z> </math> is defined to be <math>\lVert \vec{v} \rVert = \sqrt{v_x^2 + v_y^2 + v_z^2}</math>.
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'''):


In other systems, the magnitude of some vector is found by taking the square root of all of its components squared: <math>\lVert \vec{v} \rVert = \sqrt{v_x^2 + v_y^2 + v_z^2 ...+v_n^2}</math>.
<math>\hat{v} = \frac{1}{\|v\|}v</math>


The magnitude of a vector can represent a variety of characteristics, depending on the situation. The magnitude of the vector, and the vector itself, has units corresponding to the characteristic it represents.
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.


Note that a vector does not necessarily extend from one point in real, physical space to another; unless the magnitude is in units of length, the magnitude of the vector usually represents a property that exists at a single point in real, physical space, or no position in particular.
===Orthonormal Bases===


[[File:IMG_0325613.jpg|400px|Image: 400 pixels]]
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>).


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


By dividing a vector by its magnitude, the vector's magnitude will be equal to 1, creating a unit vector: <math>\hat{v} = \frac{\vec{v}}{\lVert \vec{v} \rVert} = <v_x, v_y, v_z>/\sqrt{v_x^2 + v_y^2 + v_z^2}</math>. The answer would be in the form of a vector.
<math>\hat{x} = (1, 0, 0), \qquad \hat{y} = (0, 1, 0), \qquad \hat{z} = (0, 0, 1)</math>


A unit vector is denoted by a letter with a ^ symbol written over it: <math>\hat{v}</math>. Certain letters represent specific unit vectors. Non-Cartesian coordinate systems often have their own different unit vectors. For example, 2D polar coordinates make use of the <math>\hat{r}</math> and <math>\hat{\theta}</math> unit vectors.
(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:


A simple example of unit vectors are the axes of the 3D-map which are notated as <math>\hat{x}, \hat{y}, \hat{z}</math>. This is spoken as x-hat, y-hat, and z-hat.
<math>v = \langle v, \hat{x} \rangle \hat{x} + \langle v, \hat{y} \rangle \hat{y} + \langle v, \hat{z} \rangle \hat{z}</math>
These unit vectors are equal to <math><1, 0, 0> </math>, <math><0, 1, 0> </math>, <math><0, 0, 1> </math> respectively.


===Direction===
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.


The direction of a vector refers to the direction along which the vector acts.
===Direction and Angles===


In a 2-dimensional space, the direction refers to the angle from the positive x -axis.
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'''.


The direction of a vector in a 2-dimensional space can be easily calculated by using the following formula:
To quantify relative direction between any two nonzero vectors <math>u, v \in \mathbf{R}^n</math>, we rely on the '''Cauchy–Schwarz inequality''':


<math>\theta = arctan(v_y/v_x)</math>
<math>|\langle u, v \rangle| \le \|u\|\|v\|</math>


===Simple Examples of Vector Quantities===
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:


====Position====
<math>\cos\theta = \frac{\langle u, v \rangle}{\|u\|\|v\|}</math>
A person's position can be represented in vector form. Position relative to another object is found by subtracting their respective vector forms. Finding the magnitude of the relative position vector will find the shortest path distance between the two objects. A very common use of the position vector is finding a position relative to the origin. To do this, we subtract the zero vector from the given position vector. This allows for easy manipulation of the position vector because it is centered at zero.


====Velocity====
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>).
Velocity can be represented in vector form. The velocity of an object, often given in meters per second (m/s), is a scalar value describing how quickly the object is moving. Speed is the magnitude of the velocity vector. However, the object's movement happens in a particular spatial direction, which the speed alone does not tell us. The direction of the object's movement is also a part of the velocity vector. Together, speed and direction comprise the velocity vector and give a complete description of an object's motion at a point in time.


The velocity vector can be calculated by calculating the derivative of the position vector.
'''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>.
* 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>.


For example, let <math>\vec{r}</math> be a position vector equaling to <math><t, 1, 0> m</math>. Where t is equal to the time in seconds. To get the velocity vector, we calculate the derivative of <math>\vec{r}</math> to get the velocity vector <math>\vec{v}</math>:
==Vector Operations==
 
<math>\vec{v} = <1, 0, 0> m/s </math>


The speed would be the magnitude of the velocity vector, which is equal to 1 m/s.
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>.


[[File:Velwiki.png]]
===Addition and Subtraction===


====Weight (Force of Gravity)====
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>:
Weight is also a vector, typically with only a component in the y-direction. Weight is usually represented by the force of gravity, <math>\vec{F_g}</math>,  on an object. We represent <math>\vec{F_g}</math> as follows:


<math> \vec{F_g} = <0, -mg, 0> </math>
<math>\vec{a} + \vec{b} = (a_x + b_x,\; a_y + b_y,\; a_z + b_z)</math>


Where <math>g</math> is the Earth's gravitational constant 9.8 <math> m/s^2 </math> and <math>m</math> is the mass of the object. Because the gravitational force is always pointed down towards the Earth, it is always displayed as a negative value in the <math>-y</math> direction. This then commonly yields weight in Newtons (N). The magnitude of the force of gravity, <math>|\vec{F_g}| = mg</math> is the weight of the object, also called the weight force.
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>.
 
===Visually Representing Vectors===
 
Vectors are visually represented by arrows. The length of the arrow represents the magnitude of the vector, while the direction the arrow points in represents the direction of the vector. If a vector exists at a particular point in space, the "tail" of the arrow, or the start of the arrow, should be placed at that point.
 
This example shows a visual representation of the velocity vector of a ball, which is moving to the right at a speed of 5 m/s.
 
[[File:Vectorvisualrepresentation.png]]
 
==Vector Operations==
 
It is possible to perform a variety of mathematical operations on vectors, both with other vectors and with scalars. These operations appear in a variety of formulas in physics. To make the operations easier to learn, they are defined below assuming all vectors to be 3-dimensional; the more general n-dimensional definitions look more confusing. If necessary, it is easy to guess how to perform each operation with n-dimensional vectors by extrapolating from the 3-dimensional case.
 
===Addition===
 
<math>\vec{a} + \vec{b} = \langle (a_x + b_x), (a_y + b_y), (a_z + b_z) \rangle</math>.
 
In other words, to add two vectors, simply add the vector's components to form the new components. In order to add two vectors together, your first have to identify the heads and the tails of the vectors. Using the head to tail method, you place the head of the second vector on the tail of the first vector. Then, you draw a connecting vector also known as the resultant vector, seen here in red, from the tail of the first vector to the tip of the second vector. The resultant vector is the sum of the two vectors.


[[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:


<math>\vec{a} - \vec{b} = \vec{a}+(-\vec{b}) = \langle (a_x - b_x), (a_y - b_y), (a_z - b_z) \rangle</math>.
<math>\vec{a} - \vec{b} = \vec{a} + (-\vec{b}) = (a_x - b_x,\; a_y - b_y,\; a_z - b_z)</math>
 
In other words, to subtract two vectors, simply subtract their like components to form the new components.


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


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


<math>k \cdot \vec{a} = \langle k \cdot a_x, k \cdot a_y, k \cdot a_z \rangle</math>.
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>:


In other words, multiplying a vector by a scalar multiplies each of that vector's components by that scalar, yielding a vector. This will only affect a vector's magnitude, not its direction, unless the scalar is negative, in which case the direction of the vector will be reversed.
<math>\lambda \vec{a} = (\lambda a_x,\; \lambda a_y,\; \lambda a_z)</math>


[[File:Vectorscalarmultiplication.png|400px]]                          [[File:IMG_0327.jpg|400px|Image: 400 pixels]]
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>.


===Division by Scalar===
[[File:Vectorscalarmultiplication.png|400px]] [[File:IMG_0327.jpg|400px|Image: 400 pixels]]


Division by a scalar behaves exactly like scalar multiplication. Each component is divided by the scalar, thus yielding a vector. This can also be accomplished by multiplying each component by the reciprocal of the scalar: <math> 1/(scalar) </math>
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>:


The scalar in this case being k.
<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===


===Dot Product (also called Scalar Product)===
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>:


<math>\vec{a}\cdot\vec{b} =(a_x \cdot b_x) + (a_y \cdot b_y) + (a_z \cdot b_z)</math>.
<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>


The dot product of two vectors is the sum of the products of their like components, and this operation yields a scalar. This quantity makes it easy to see the relationship between two vectors in a simple scalar quantity.
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:


One of the most common uses of the dot product is to use it to check whether two vectors are orthogonal (perpendicular) to one another. Two vectors are orthogonal if (and only if) their dot product is equal to 0.
<math>\vec{a} \cdot \vec{b} = \|\vec{a}\|\|\vec{b}\|\cos\theta</math>


It is important to note that the dot product of two vectors has a specific value: <math>\vec{a}\cdot\vec{b} = |\vec{a}| \cdot |\vec{b}| \cdot \cos(\theta)</math>, where <math>\theta</math> is the angle between the vectors.
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>.


[[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 definition of a cross product, which is also the one found on the formula sheet, 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 = (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,\; a_z b_x - a_x b_z,\; a_x b_y - a_y b_x)</math>


While this definition may appear overwhelming, it helps in application to remember that the result of taking the cross product of two vectors is a third vector that is orthogonal (perpendicular) to both of the original vectors. The order of terms in a cross product determines the sign of the resulting vector, so it is important to have vectors in the correct order when you compute a cross product.
Written in the standard orthonormal basis <math>\hat{i}, \hat{j}, \hat{k}</math>, this is equivalently:


Computing a cross product is equivalent to taking the determinant of a matrix of the following form:
<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>


<math>\begin{vmatrix}
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 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>\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>


In order to find the determinant of a 3x3 matrix, it can be helpful to use process of cofactor expansion. The below image shows how this works. You cross out the first row, and then the column corresponding to i. Then, find the determinant of the smaller 2x2 matrix created by this simplification. Perform this 2 more times with j and k, and do not forget that the j term is always subtracted!
[[File:Expansionbyminors.png|400px]]
[[File:Expansionbyminors.png|400px]]


Here is a website to conduct cross products and see the steps for how to solve them if you need more help: [https://www.symbolab.com/solver/vector-cross-product-calculator https://www.symbolab.com/solver/vector-cross-product-calculator]
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]


Here is a generic video displaying the formula being used: [https://www.youtube.com/watch?v=e9T5p_Jwv5c https://www.youtube.com/watch?v=e9T5p_Jwv5c]
Geometrically, the norm of the cross product equals the '''area of the parallelogram''' spanned by <math>\vec{a}</math> and <math>\vec{b}</math>:


The cross product of two vectors results in another vector in <math> <\hat{i}, \hat{j}, \hat{k}></math> form. It is important to note that the <i>magnitude</i> of the cross product of two vectors has a specific value: <math>|\vec{a}\times\vec{b}| = |\vec{a}| \cdot |\vec{b}| \cdot \sin(\theta)</math>, where <math>\theta</math> is the angle between the vectors.
<math>\|\vec{a} \times \vec{b}\| = \|\vec{a}\|\|\vec{b}\|\sin\theta</math>


The direction of the cross product of two vectors is perpendicular to the plane in which those vectors lie and is given by the [[Right Hand Rule]]. 2D vectors do not have cross products. While the other operations listed here are commutative, associative, and distributive over addition the cross product operation is not associative and is anti-commutative (i.e., <math>\vec{a}\times\vec{b} = -\vec{b}\times\vec{a}</math>), meaning that if the order of the factors is reversed, their cross product will be reversed in direction.
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>).


<b>For more mathematically-advanced students</b>, I will invoke some higher-level linear algebra. Recall that the null space, defined as <math>\operatorname{Null}(A) = \{ \vec{v} \in \mathbb{R}^n \mid A\vec{v} = \vec{0} \}</math> for an arbitrary matrix <math>A \in \mathbb{R}^{m \times n}</math>, is the orthogonal complement of its row space. That is, for all <math>\vec{v} \in \operatorname{Null}(A)</math> and for all rows <math>\vec{a}_{j}</math> of <math>A</math>, we have that <math>\vec{a}_j \cdot \vec{v} = 0</math>. This is because, since <math>\vec{v} \in \operatorname{Null}(A)</math>, we have that
====Component Pattern ("X-Method")====


<math displaystyle="true">A\vec{v} = \begin{bmatrix}\vec{a}_1 \\ \vec{a}_2 \\ \vdots \\ \vec{a}_m\end{bmatrix}\vec{v} = \begin{bmatrix}0 \\ 0 \\ \cdots \\ 0\end{bmatrix}.</math>  
A fast computational pattern avoids writing out the full <math>3 \times 3</math> determinant. Consider:
Now, recall how matrix vector multiplication works! We see that
<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 \\ \cdots \\ 0\end{bmatrix}</math>. Since all of the dot products are 0, <math>v</math> is orthogonal to all of the rows of <math>A</math>. Therefore, we can conclude that <math>v</math> is orthogonal to the whole row space of the matrix <math>A</math>.


For two vectors <math>\vec{a},\vec{b} \in \mathbb{R}^{3}</math> that are not scalar multiples of one another, if we think of <math>\vec{a}, \vec{b}</math> as corresponding rows in a matrix <math>A</math>, then the null space contains the set of all vectors orthogonal to them both simultaneously. In particular, it contains the unique vector produced by taking the cross product of both vectors. Once we fix what direction is the right direction, and what is the appropriate magnitude, we would then yield a unique vector in the nullspace that is equal to their cross product. <b>This is why the right-hand rule works.</b> (That is, this is why it yields a unique result.) If we visualize the plane spanned by two vectors with our index and middle fingers, then their null space will be perpendicular to the intersection point of the two vectors, or rather the thumb. Likewise, if we use all of our fingers and our thumb to make an L-shape representing the span of the two vectors, upon curling our fingers, we will have the direction of the cross product, which is orthogonal to the two vectors represented by your thumb and fingers. (If we were in <math>\mathbb{R}^4</math>, this would be much trickier, since the dimension of the nullspace would be 2 dimensional, and as a result, even after fixing the appropriate magnitude, we would have an infinite number of <i>directions</i> we could chose from.)
<math>\vec{a} = (3, -2, 4), \qquad \vec{b} = (-1, 6, 3)</math>


====Another Cross Product Trick====
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:
This trick can be used to calculate the cross product quickly. This is done by bypassing the need to create a big matrix and creating a simple visual representation to quickly calculate the determinants.


The best way to explain this trick is to use an example.
<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>


Let there be two vectors <math>\vec{a}</math> and <math>\vec{b}</math>.
* For <math>c_x</math>, cross-multiply rows 2 and 3 (<math>a_y b_z - a_z b_y</math>):


<math>\vec{a} = <3, -2, 4></math>
[[File:Cx.png]]
<math>\vec{b} = <-1, 6, 3></math>


Find <math>\vec{a} \times \vec{b}</math>.
:<math>c_x = (-2)(3) - (4)(6) = -6 - 24 = -30</math>


To use this trick, section out the vectors in this order like so:
* For <math>c_y</math>, cross-multiply rows 3 and 4 (<math>a_z b_x - a_x b_z</math>):


<math>\begin{vmatrix}
[[File:Cy.png]]
a_x \\
a_y \\
a_z \\
a_x
\end{vmatrix}</math> <math>\times</math> <math>\begin{vmatrix}
b_x \\
b_y \\
b_z \\
b_x
\end{vmatrix}</math> <math>=</math> <math>\begin{vmatrix}
c_x \\
c_y \\
c_z
\end{vmatrix}</math>


<math>\begin{vmatrix}
:<math>c_y = (4)(-1) - (3)(3) = -4 - 9 = -13</math>
3 \\
-2 \\
4 \\
3
\end{vmatrix}</math> <math>\times</math> <math>\begin{vmatrix}
-1 \\
6 \\
3 \\
-1
\end{vmatrix}</math> <math>=</math> <math>\begin{vmatrix}
c_x \\
c_y \\
c_z
\end{vmatrix}</math>


Now to solve for the cross product.
* For <math>c_z</math>, cross-multiply rows 1 and 2 (<math>a_x b_y - a_y b_x</math>):


For <math>c_x</math>, draw an X that connects <math>a_y</math> to <math>b_z</math> and <math>a_z</math> to <math>b_y</math>.
[[File:Cz.png]]


[[File:Cx.png]]
:<math>c_z = (3)(6) - (-2)(-1) = 18 - 2 = 16</math>


Now to calculate <math>c_x</math>, multiply the values of the first line of the X and multiply the values of the second line of the X.
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>.


Then subtract both those values to calculate <math>c_x</math>.


A mathematical form of this would look like this:
====Advanced Note: What the Cross Product Really Measures (and Why 3D Is Special)====


<math>c_x = a_y*b_z - a_z*b_y</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">


<math>c_x = -2*3 - 4*6 = -6 - 24</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.


<math>c_x = -30</math>
'''1. Components as Signed Shadow Areas'''


For <math>c_y</math>, do the same thing except draw an X that connects <math>a_z</math> to the bottom <math>b_x</math> and the bottom <math>a_x</math> to <math>b_z</math>.
Look at the three components of <math>\vec{c} = \vec{a} \times \vec{b}</math>:


[[File:Cy.png]]
<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>


Then do the same concept as <math>c_x</math>:
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).


<math>c_y = a_z*b_x - a_x*b_z</math>
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_y = 4*-1 - 3*3 = -4 - 9</math>
'''2. The Determinant Formula as Signed Volume'''


<math>c_y = -13</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


Then for <math>c_z</math>, do the same thing by drawing an X that connects <math>a_x</math> to <math>b_y</math> and <math>a_y</math> to <math>b_x</math>.
<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>


[[File:Cz.png]]
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>:


Then do the same concept as <math>c_x</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>


<math>c_z = a_x*b_y - a_y*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.


<math>c_z = 3*6 - -2*-1 = 18 - 2</math>
'''3. Why Two-Vector Cross Products Are Special to 3D (and the 7D Exception)'''


<math>c_z = 16</math>
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.


Now the cross product has been finished with the answer that <math>\vec{a} \times \vec{b} = <-30, -13, 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.


As this trick is practiced extensively, the following can be done to make calculations must faster:
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.


- Skipping the drawing of the X as practitioners will know what values to multiply and subtract.
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).


- Removing the 4th vector x value on the bottom of the visual representation.
</div>
</div>


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


Sometimes, you might encounter formulas or situations where vector-specific operations, such as a dot product or a cross product, are combined in some way. In this case, it can help to remember these two facts:
When combining dot products and cross products in <math>\mathbf{R}^3</math>, two identities are particularly useful:


<ol><li><math>(w⨯v)•v=0</math>, because the vector produced by the cross product is orthogonal to both <math>w</math> and <math>v</math>, and therefore that vector dotted with either of the original two vectors will always equal zero.
# '''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>a•(b⨯c)=(a⨯b)•c</math>. This property can be useful in situations where computing <math>a⨯b</math> is easier than computing <math>b⨯c</math>. Note that the order of the vectors still matters here in the cross products, but that the dot product commutes.
# '''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.
</ol>


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


The information necessary to describe a specific vector can be presented in several forms.
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, the magnitude and the direction of the vector are explicitly stated. The statement describing direction might be a cardinal direction (ex. "North"), a direction on a graph (ex. "the +x direction"), or an angle (ex. "210<math>^\circ</math> from the x axis counterclockwise"), depending on the situation. Magnitude and direction form is often used in word problems because it is easy to understand. This also makes it easier to measure vectors in real world applications. When building structures, it is much easier to say that you want a 5 foot plank of wood 60<math>^\circ</math> off of the ground.  
In this form, we specify:
* The norm (magnitude) <math>\|\vec{a}\|</math>, and
* The orientation (an angle, cardinal direction, or axis).
 
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.


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


In this form, the vector is divided into components, each representing a different coordinate direction. In 2D space, these are the x and y directions. In 3D space, these are the x, y, and z directions. Each component tells how much the vector extends in that particular direction. Often, the three components are written enclosed by angle brackets and separated by commas. For example, the vector <math> <2,0,-3> </math> describes a vector that extends 2 units in the <math>\hat{+x}</math> direction, 0 units in the <math>\hat{y}</math> direction, and 3 units in the <math>\hat{-z}</math> direction. Most vector operations described above can only be performed if the vectors are in component form, so this form may be necessary to do math for certain problems. Additionally, it is important to note that programming languages store vectors in component form.
Once a basis is decided, we break the vector into components along the coordinate axes. In <math>\mathbf{R}^3</math>:
 
<math>\vec{a} = (a_x, a_y, a_z)</math>
 
For example, <math>(4, 3, 0)</math> means the vector extends 4 units along <math>+x</math>, 3 along <math>y</math>, and 0 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 this form, the vector is expressed as a sum of unit vectors, each corresponding to a different coordinate direction. The symbols <math>\hat{i}</math>, <math>\hat{j}</math>, and <math>\hat{k}</math> OR the symbols <math>\hat{x}</math>, <math>\hat{y}</math>, and <math>\hat{z}</math> are used to represent unit vectors in the x, y, and z directions respectively. Consider the vector <2,0,-3>. It can be expressed in unit vector form as <math>2\hat{i} - 3\hat{k}</math>, meaning 2 times the x direction unit vector minus 3 times the z direction unit vector. While often considered its own form, unit vector form is very similar to component form, as the information describing the vector is stored in the same values. All references to component form in the rest of this page also apply to unit vector form.
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>\vec{a} = a_x \hat{i} + a_y \hat{j} + a_z \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.


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


Note that regardless of which form is used, an n-dimensional vector requires n values to mathematically describe. For example, consider a 3-dimensional vector. Describing this vector in component form requires an x value, a y value, and a z value. Describing it in magnitude and direction form requires one value to give the magnitude of the vector and two to give the its direction. The direction of a 3D vector could be described using, say, its polar angle <math>\theta</math> and its azimuthal angle <math>\phi</math>. A 1-dimensional vector, such as the velocity of a particle whose movement is constrained to the x axis, can be described using only 1 value whose sign indicates the vector's direction.
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===


It is possible to convert vectors from one form to another using simple trigonometry.
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:


To find the magnitude of a vector in component form, use the Pythagorean theorem: add the squares of the components and take the square root of the result. For a 2D vector, <math>|\vec{a}| = \sqrt{a_x^2 + a_y^2}</math>.
* '''Components to magnitude and direction:'''
 
:<math>\|\vec{a}\| = \sqrt{\langle \vec{a}, \vec{a} \rangle} = \sqrt{a_x^2 + a_y^2}</math>
To find the direction of a vector in component form, use inverse trigonometric functions. For a 2D vector, <math>\theta = \tan^{-1}(\frac{a_y}{a_x})</math>, where <math>\theta</math> is the angle vector <math>\vec{a}</math> makes with the x axis in the counterclockwise direction.
:<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>.)
To find the components of a vector in magnitude and direction form, use trigonometric functions. For a 2D vector, <math>a_x = |\vec{a}|\cos\theta</math> and <math>a_y = |\vec{a}|\sin\theta</math>, where <math>\theta</math> is the angle vector <math>\vec{a}</math> makes with the x axis in the counterclockwise direction.
* '''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==


The construction for a vector object is the word <code>vec</code> or <code>vector</code> and it takes three arguments, which define its x, y and z components respectively.
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:


The following is an example of a vector instantiation:
<pre>
velocity = vec(3, -1, 2)
</pre>


<code>velocity = vec(3,-1,2)</code>
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 this example, a vector named <code>velocity</code> is created with an x value of 3, y value of -1, and z value of 2.
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.


In VPython, vector objects are in component form; each one has an x, y, and z component. Recall that in VPython, using the default camera orientation, the +x axis points to the right, the +y axis points upwards, and the +z axis points out of the plane of the screen towards the viewer.
===Modifying Vectors===


===Modifying Vectors===
Individual components can be accessed or updated with <code>.x</code>, <code>.y</code>, and <code>.z</code>:
To access or modify a specific component of a vector object, its name should be followed by a period and an x, y, or z. For example, to change the x component of the above velocity vector from 3 to 5, the following line might be used:


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


===Helpful Vector Functions===
===Helpful Vector Functions===
====Magnitude====
====Magnitude====
To calculate the magnitude of a vector, the <code>mag</code> function is used. The <code>mag</code> function takes in one argument of a vector.


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


velocity = vec(3, -1, 2)
<pre>
speed = mag(velocity) # use mag to calculate the magnitude of the velocity vector
velocity = vec(3, -1, 2)
speed = mag(velocity) # magnitude of velocity
</pre>


===Normalize===
====Normalize====
To normalize a vector or calculate the unit vector, the <code>norm</code> function is used. The <code>norm</code> function takes in one argument of a vector.


'''Example Usage'''
To obtain a unit vector in the same direction (normalize a vector), use <code>norm</code>:


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


===Dot and Cross Prodcut===
To get the dot product of two vectors, the <code>dot</code> function is used.
To get the cross product of two vectors, the <code>cross</code> function is used.


Both functions take in two arguments that are both vectors.
====Dot and Cross Product====


'''Example Usage'''
The functions <code>dot</code> and <code>cross</code> compute dot and cross products:


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


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


To visualize vectors in VPython, the <code>arrow</code> object is used.
To visualize vectors, VPython provides the <code>arrow</code> object, specified by:
* <code>pos</code> – tail position,
* <code>axis</code> – direction and length of the arrow (a vector).
 
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]).


To initialize an arrow, a position vector and a direction vector must be passed.
<pre>
There are optional parameters to increase the size and shape of the arrow:
velocity = vec(1, 1, 0)
- shaftwidth
origin = vec(0, 0, 0)
- headwidth
shaftwidth = 0.1
- headlength
vel_arrow = arrow(pos=origin, axis=velocity,
                  shaftwidth=shaftwidth, color=color.red)
</pre>


Attributes of the arrow can also be changed, such as color. Read more [https://www.glowscript.org/docs/VPythonDocs/arrow.html here].
[[File:Arrow_viz.png]]
''Output in VPython of a visualized vector''


For example, this is how a velocity vector is visualized with an arrow at the origin:
===A Computational Model===


velocity = vec(1,1,0) # velocity vector (required parameter)
[https://trinket.io/glowscript/3d7c75ed91 Click here to run the interactive GlowScript computational model.]
origin = vec(0, 0, 0) # position vector for the origin (required parameter)
shaftwidth = 0.1 # optional parameter
vel_arrow = arrow(pos=origin, axis=velocity, shaftwidth=shaftwidth, color=color.red) # create visualization of arrow


[[File:Arrow_viz.png]]
This model walks through basic vector operations step by step. It starts by defining vectors as arrows, then explores:
''Output in VPython of Visualized Vector''


==A Computational Model==
* Addition and subtraction 
* Scalar multiplication 
* Magnitude and unit vectors 
* Dot and cross products 


[https://trinket.io/glowscript/3d7c75ed91 Click Here to run the interactive computational model] This computational model breaks each vector operation down. It begins with defining the vector, and then goes into different vector operations. These operations are broken into both their written formula and the Glowscript shortcut function. Play around with the numbers and vector definitions to see what happens! It begins by defining the vectors as arrows, and that's all you need to play around with the different functions! You may also want to comment out some of the sections, so you can see how each function works individually.
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}</math> is <2.5, 7.4, 8.0>. What is the magnitude and direction of Vector A?
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:


Solution:
<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>


First, we must find the magnitude.
<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>


<math>|<2.5, 7.4, 8.0>| = \sqrt{2.5^2 + 7.4^2 + 8.0^2}</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>.


<math> = \sqrt{6.25 + 54.76 + 64} </math>
</div>
</div>


<math> = \sqrt{125.01} </math>
===Simple===


<math> = 11.18 </math>
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>.


Now, we must find the direction by finding the unit vector.
<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> unit vector = \vec{a} / mag(a) </math>
Compute the combination coordinate-wise:


<math> x = 2.5/11.18 = .224 </math>
<math>\vec{a} - 2\vec{b} = (2, 4, 2) - 2(-1, 1, 3) = (2, 4, 2) - (-2, 2, 6) = (4, 2, -4).</math>


<math> y = 7.4 / 11.18 = .662 </math>
Now find its norm:


<math> z = 8.0 / 11.18 = .716 </math>
<math>\|(4, 2, -4)\| = \sqrt{4^2 + 2^2 + (-4)^2} = \sqrt{16 + 4 + 16} = \sqrt{36} = 6.</math>


<math> direction = <.224, .662, .716> </math>
</div>
</div>


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


Vector <math>\vec{a}</math> is <2,4,2>. Vector <math>\vec{b}</math> is <-1,1,3>. What is the magnitude of the vector <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>.


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">


<math>\vec{a} - 2\vec{b} = <2,4,2> - 2 * <-1,1,3> </math>
From the inner product angle formula:


<math> = <2,4,2> - <-2,2,6> </math>
<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>


<math> = <4,2,-4></math>
Compute the inner product:


We  are asked to find the magnitude of this vector, so let us use the Pythagorean theorem with its components:
<math>\langle \vec{a}, \vec{b} \rangle = 2(3) + 5(-4) + (-2)(-1) = 6 - 20 + 2 = -12.</math>


<math>|<4,2,-4>| = \sqrt{4^2 + 2^2 + (-4)^2}</math>
Compute the norms:


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


<math> = \sqrt{36} </math>
<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> = 6 </math>


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


An airplane is travelling in still air at 240m/s in the direction 35<math>^\circ</math> south of west. A wind begins to blow; the wind has a speed of 80m/s in the direction 15<math>^\circ</math> east of north. What should be the new velocity of the plane relative to the air around it to maintain its original trajectory? You may give your answer in component form (+x is east, +y is 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">


The vector sum of the new velocity of the plane <math>\vec{v_{p,1}}</math> and the velocity of the wind <math>\vec{v_w}</math> should equal the original velocity of the plane <math>\vec{v_{p,0}}</math> (see [[Relative Velocity]]):
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.


[[File:Vectorsplanesolution.png]]
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_{p,1}} + \vec{v_w} = \vec{v_{p,0}} </math>
<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_{p,0}} - \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>


Let us convert the given vectors to component form for easier subtraction. The +x and +y directions will be east and north respectively.
Subtract component-wise:


<math>\vec{v_{p,0}} = <240\cos(215^\circ), 240\sin(215^\circ)></math>m/s (35<math>^\circ</math> south of west is 215<math>^\circ</math> above the x axis)
<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>\vec{v_{p,0}} = <-196.6, -137.7> </math>m/s
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.


<math>\vec{v_w} = <80\cos(75^\circ), 80\sin(75^\circ)></math>m/s (15<math>^\circ</math> east of north is 75<math>^\circ</math> above the x axis)
</div>
</div>


<math>\vec{v_w} = <20.7, 77.3> </math>m/s
===Intermediate===


Now let us subtract:
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>.


<math> \vec{v_{p,1}} = \vec{v_{p,0}} - \vec{v_w} </math>
# 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_{p,1}} = <-196.6, -137.7> - <20.7, 77.3> </math>m/s
<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> \vec{v_{p,1}} = <-217.3, -214.9> </math>m/s
'''1. Compute <math>\vec{\tau} = \vec{r} \times \vec{F}</math>:'''


===Difficult===
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>:


What is the angle between the vectors <2,5,-2> and <3,-4,-1>?
<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>


Solution:
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>


The dot product between two vectors is equal to the product of their magnitudes times the cosine of the angle between them. Let us use this property to find the angle between the given vectors.
Thus,


<math> <2,5,-2> \cdot <3,-4,-1> = |<2,5,-2>| * |<3,-4,-1>| * \cos\theta </math>
<math>\vec{\tau} = (6,\; 9,\; 18)\ \text{N}\cdot\text{m}.</math>


Rearranging this yields
''(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.)''


<math> \theta = \cos^{-1}\frac{<2,5,-2> \cdot <3,-4,-1>}{|<2,5,-2>| * |<3,-4,-1>|} </math>
'''2. Find the magnitude <math>\|\vec{\tau}\|</math>:'''


Let us evaluate the dot product and simplify:
<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>


<math> \theta = \cos^{-1}\frac{2(3) + 5(-4) + (-2)(-1)}{\sqrt{2^2 + 5^2 + (-2)^2} * \sqrt{3^2 + (-4)^2 + (-1)^2}} </math>
'''3. Verify orthogonality and anticommutativity:'''


<math> \theta = \cos^{-1}\frac{-12}{\sqrt{33 * 26}} </math>
Compute the inner product of <math>\vec{\tau}</math> with <math>\vec{r}</math> and with <math>\vec{F}</math>:


<math> \theta = 114^\circ </math>
<math>\langle \vec{\tau}, \vec{r} \rangle = 6(0.3) + 9(-0.4) + 18(0.1) = 1.8 - 3.6 + 1.8 = 0,</math>


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


Vectors play a part in almost every part of our lives. For example, the desk you are probably sitting at was built by using vectors. A force vector is used to represent things like the force of gravity (0, mg, 0), to represent how the pieces within the desk are exerting forces on each other, and a vector to represent the force of the floor on the desk. This just scratches the surface of the vectors that can represent a desk. Any measurement taken, for example the diagonal across the desk, can be represented as a vector.  
Since both inner products vanish, <math>\vec{\tau}</math> is orthogonal to both <math>\vec{r}</math> and <math>\vec{F}</math>.


Another example of vectors in everyday life is how they can represent how we move. Your position can be represented as a vector relative to any other spot in the universe. To find your relative position vector, you take your position vector and subtract the other vector from it. Velocity can also be represented in vector form. When you move, you have a certain velocity in each direction, so it can be represented in vector form. This can also be found by taking the derivative of the position vector with respect to time. The velocity vector can also be integrated to find the position vector. The magnitude of the velocity vector is equivalent to the speed that one is travelling. Acceleration can be represented by taking the derivative of the velocity vector. Each of these vectors can be broken into their components to be able to see how you are traveling in each direction.
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:


Vectors are a very important part of most Physics 2 material. Nearly every quantity we are looking for is represented as a vector. Electric field, Magnetic field, all of the forces, and many other things. For example, the Magnetic Force on a point particle is represented as follows:
<math>\vec{F} \times \vec{r} = -\vec{\tau} = (-6,\; -9,\; -18)\ \text{N}\cdot\text{m}.</math>


<math>{\vec{F} = q\vec{v}\times\vec{B}}</math>
</div>
</div>


This uses both the cross products of 2 vectors and multiplying that cross product, a vector, by a scalar. Vector knowledge is very important in Physics 2, as it is the basis for nearly everything we do.
===Challenging===


Most scientific disciplines don't rely as heavily on vector forms as Physics. Because Physics is so focused on the motion of different things (people, particles, objects), vectors are an integral part of Physics. Even planets move according to patterns described by vectors. Every physical quantity, no matter how big or small, can be represented in vector form.
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


==History==
<math>\|\vec{u}\| = 3, \qquad \|\vec{u} + \vec{v}\| = 4, \qquad \|\vec{u} - \vec{v}\| = 6.</math>


It is unknown who first developed the idea of vectors, but the oldest known reference to vectors is in the work <i>Mechanics</i> by Hero of Alexandria in the first century AD, which described their addition. At this point, however, the idea of a vector was little more than a line segment with a specific orientation. They had a length extending from one point in physical space to another but were not used to represent anything else.
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>.


In the early 19th century, several mathematicians and physicists including Caspar Wessel (1745-1818), Jean Robert Argand (1768-1822), Carl Friedrich Gauss (1777-1855), and William Rowan Hamilton (1805-1865) used 2D vectors to represent complex numbers. One component would represent the real value and another would represent the imaginary value. Hamilton would also become the first to use the word "vector." August Ferdinand Möbius (1790-1868) contributed to vector math in his 1827 book <i>The Barycentric Calculus</i>, in which he developed the convention of labeling vectors with letters and defined the multiplication of a vector by a scalar. Hermann Grassmann (1809-1877) wrote in his 1844 book <i>Ausdehnungslehre</I>, German for "The Calculus of Extension", that vectors could exist in the space of any number of dimensions and described much of what would become linear algebra, which makes ample use of vectors.
<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">


The modern language and conventions surrounding vectors come largely from notes created by J. Willard Gibbs (1839-1903), a professor at Yale University, and Oliver Heaviside (1850-1925), a significant English Physicist. They used their development of how vectors are modernly used to demonstrate the laws of electromagnetism discovered by James Clerk Maxwell.
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:


==See Also==
<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.


===External Links===
</div>
Mathematical Computations on Vectors: [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]
</div>


Computational Work with Vectors: [http://vpython.org/contents/docs/vector.html http://vpython.org/contents/docs/vector.html]
==Applications and History==


Basics of Vectors: [https://www.physics.uoguelph.ca/tutorials/vectors/vectors.html https://www.physics.uoguelph.ca/tutorials/vectors/vectors.html]
===Applications Across Disciplines===
Vectors appear in many everyday and engineering contexts.


===Further Reading===
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.


Vector Analysis by Josiah Willard Gibbs
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.


Introduction to Matrices and Vectors by Jacob T. Schwartz
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.


==References==
===History===
[https://mathinsight.org/definition/magnitude_vector https://mathinsight.org/definition/magnitude_vector]


[https://www.mathsisfun.com/algebra/vectors.html https://www.mathsisfun.com/algebra/vectors.html]
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.


[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 ]
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.”


[http://mathinsight.org/vector_introduction http://mathinsight.org/vector_introduction]
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.


[http://www.math.mcgill.ca/labute/courses/133f03/VectorHistory.html http://www.math.mcgill.ca/labute/courses/133f03/VectorHistory.html]
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.


[https://www.glowscript.org/docs/VPythonDocs/vector.html https://www.glowscript.org/docs/VPythonDocs/vector.html]
==See Also==


[https://www.glowscript.org/docs/VPythonDocs/arrow.html https://www.glowscript.org/docs/VPythonDocs/arrow.html]
===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]
* [https://www.glowscript.org/docs/VPythonDocs/vector.html VPython / GlowScript Vector Documentation]
* [https://www.physics.uoguelph.ca/tutorials/vectors/vectors.html University of Guelph: Introductory Vector Tutorial]
 
===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)


[https://www.britannica.com/science/vector-mathematics https://www.britannica.com/science/vector-mathematics]
==References==
* Axler, Sheldon. [https://linear.axler.net ''Linear Algebra Done Right''] (4th ed., Springer, 2024).
* [https://mathinsight.org/vector_introduction Math Insight: An Introduction to Vectors]
* [https://mathinsight.org/definition/magnitude_vector Math Insight: Magnitude of a Vector]
* [https://www.mathsisfun.com/algebra/vectors.html Math is Fun: Vectors]
* [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 McGill University: Brief History of Vectors]
* [https://www.glowscript.org/docs/VPythonDocs/vector.html GlowScript / VPython Documentation: Vectors]
* [https://www.glowscript.org/docs/VPythonDocs/arrow.html GlowScript / VPython Documentation: Arrow]
* [https://www.britannica.com/science/vector-mathematics Encyclopædia Britannica: Vector (Mathematics)]
* [https://www.grc.nasa.gov/www/k-12/rocket/vectcomp.html NASA Glenn Research Center: Vector Components]
* [https://www.onlinemathlearning.com/dot-product.html Online Math Learning: Dot Product]


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

Latest revision as of 22:17, 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 4 units along [math]\displaystyle{ +x }[/math], 3 along [math]\displaystyle{ y }[/math], and 0 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