Vector
A vector is a quantity with magnitude and direction, represented as an ordered array of numbers, supporting addition, scalar multiplication, dot products, and cross products; it is the foundation of physics and geometry.
Purpose
To represent and manipulate directed quantities, the basis of linear algebra, physics, and graphics.
Mechanism
An n-dimensional vector [v1,...,vn]. Addition and subtraction are component-wise. Scalar multiplication scales every component. Dot product a·b=Σa_i×b_i (a projection). Cross product is 3D only, with the result perpendicular to both inputs. Norm |v|=√(Σv_i²); unit vector v/|v|.
Use cases
- 3D graphics and physics
- Machine learning feature vectors
- Force and velocity computation
- Vector space retrieval
Examples
- Input
[1,2] · [3,4] = 1×3+2×4Output11Dot product
Common errors
- Confusing the dot product with the cross product
- The dot product yields a scalar; the cross product yields a vector (3D only)
Related terms
Matrix
A matrix is a rectangular array of numbers supporting addition, subtraction, multiplication, transposition, and inversion; it is the foundation of linear algebra and computer graphics. GLOSSARY
Complex Number
A complex number has the form a+bi (i²=-1), extending the reals to two dimensions; it underpins signal processing and quantum computing. GLOSSARY
Cosine Similarity
Cosine similarity measures the cosine of the angle between two vectors, ignoring vector length; it is widely used for text-vector similarity computation. GLOSSARY