4.2.8.1 - Vectors, translation and dot products (Python)
Represent vectors as indexed values and functions, connect their operations to geometry, and implement vector combinations and dot products in Python.
List, array and function representations
A vector is an ordered collection of components drawn from the same field, such as the real numbers.
For example, is a four-component vector over , written as an element of . Its dimension is four, regardless of the component values. A Python list [2.0, 3.14159, -1.0, 2.718281828] is a practical representation; a one-dimensional numeric array also stores one component at each index. Python's list does not enforce a common field, so the program must maintain numerical components consistently.
A vector can instead be viewed as a function from its index set to the field:
Here , , and ; means “maps to”. A dictionary {0: 2.0, 1: 3.14159, 2: -1.0, 3: 2.718281828} represents that mapping. The index set is the domain and is the codomain; it does not mean this one vector contains every real value. All required indices must exist, and arithmetic must match corresponding indices. Dictionary insertion order is not the mathematical definition of a component.
Geometric vectors
A two-component vector can describe a point's position relative to the origin or a displacement from one point to another.
The vector can be drawn as an arrow from to : two units in the x direction and three in y. Its length is . A displacement arrow with the same components can begin elsewhere: from , it ends at . Its components describe change, not its starting location.
[DIAGRAM: asset_slug: vector_coordinates; description: Exact coordinate arrows for u equals 2,3 and v equals 4,1, their sum 6,4 and a convex combination at 3.5,1.5]

The blue arrow shows ; the green arrow shows . Arrow direction, endpoint and axis scale communicate the components. Negative components move in the negative axis direction. A zero vector has zero length and no defined direction. Higher-dimensional vectors still have components and algebraic operations even when they cannot be pictured on ordinary two-dimensional axes. Sketching an arrow can support your reasoning; assessment here uses supported numerical/source responses rather than scored freehand drawing.
Addition, scaling and convex combinations
Vector arithmetic combines matching components, so the vectors must have the same dimension.
For and , . Adding a displacement translates a position: every point receives the same component changes. Scalar-vector multiplication scales components. doubles the length; a negative scalar also reverses direction, while zero produces the zero vector. A positive scalar below one shortens the arrow.
A convex combination has the form , with and . Thus , the purple point on the diagram's segment between the endpoints of u and v. Coefficients 0 and 1 include the endpoints. Coefficients that sum to one but include a negative value give an affine combination outside that segment, not a convex combination. Non-negative coefficients whose sum is not one also fail the definition.
Continue this lesson.
You’re previewing NovaLearn without an account. Create a free account to read the rest.
Create free account