Before proceeding, a note about translation is necessary. For historical reasons, the Chinese terms for “vector” differ between mathematics and physics.
In physics, the term is generally translated as “vector” and contrasted with “scalar”; in mathematics, it is generally translated as “vector”. Similar differences in translation include “eigen” versus “characteristic” and “unitary” versus “unitary-matrix”, among others.
OI Wiki is mainly oriented toward engineering-related disciplines such as computer science and is closer to mathematics, so it adopts the term “vector”.
Definitions and related concepts
Vector: A quantity with both magnitude and direction is called a vector. The vectors studied in mathematics are free vectors: their starting and ending points may be translated arbitrarily as long as their magnitude and direction are unchanged. They are denoted by or .
Directed line segment: A line segment with a direction is called a directed line segment. A directed line segment has three elements: starting point, direction, and length. Once these three elements are known, its endpoint is uniquely determined. Directed line segments are commonly used to represent vectors.
Magnitude of a vector: The length of the directed line segment is called the magnitude of the vector, that is, the size of the vector. It is denoted by: or .
Zero vector: A vector with magnitude . The direction of the zero vector is arbitrary. It is denoted by: or .
Unit vector: A vector with magnitude is called the unit vector in that direction. It is generally denoted by or .
Parallel vectors: Two nonzero vectors with the same or opposite directions. They are denoted by: . Given several mutually parallel vectors, one can choose any line parallel to them; every such collection of parallel vectors can then be translated onto the same line. Thus, parallel vectors are also called collinear vectors.
Equal vectors: Vectors with equal magnitudes and the same direction.
Opposite vectors: Vectors with equal magnitudes and opposite directions.
Angle between vectors: Given two nonzero vectors , construct . Then is the angle between vectors and . It is denoted by: . Clearly, when , the two vectors have the same direction; when , they have opposite directions; and when , they are perpendicular, denoted by . We stipulate that .
Planar vectors have direction, so two vectors cannot be compared by size (although their magnitudes can be compared). However, two vectors can be equal.
Linear operations on vectors
Addition and subtraction of vectors
After defining a kind of quantity, one naturally wants to give it operations. Vector operations can be studied by analogy with numerical operations, and they can also be studied from the perspective of physics.
By analogy with displacement in physics, suppose that a person walks from through to . The displacement they undergo is , which is equivalent to the person walking directly from to , namely .
The parallelogram law for composing forces can likewise be viewed as adding vectors.
Let us summarize the laws of vector addition:
- Triangle law of vector addition: If the vectors being added are joined head to tail in order, their sum points from the starting point of the first vector to the endpoint of the last vector;
- Parallelogram law of vector addition: If the two vectors being added have a common starting point, their sum is the diagonal of the parallelogram whose adjacent sides are those two vectors. Its starting point is their common starting point, and its direction follows the diagonal of the parallelogram.
Thus, vector addition has a geometric meaning. It can also be verified that vector addition satisfies the commutative and associative laws.
Since subtraction of real numbers can be written as addition of the opposite number, we use the same form for vector subtraction. Namely: .
Now consider vectors with a common starting point and construct their difference according to the parallelogram law. After translating them, one finds that the difference vector of vectors with a common starting point is the directed line segment from the subtrahend to the minuend. This is also the geometric meaning of vector subtraction.
Sometimes, given two points , we want to find . This can be obtained using subtraction: .
Scalar multiplication of vectors
Define the product of a real number and a vector to be a vector. This operation is called scalar multiplication of vectors, denoted by , and its length and direction are specified as follows:
- ;
- When , has the same direction as ; when , ; and when , has the opposite direction to .
From the definition of scalar multiplication, the following laws can be verified:
In particular:
Determining whether two vectors are collinear
Two nonzero vectors and are collinear there is a unique real number such that .
Proof: By the definition of scalar multiplication, for a nonzero vector , if there exists a real number such that , then .
Conversely, if , , and , then when and have the same direction, and when they have opposite directions.
Finally, vector addition, subtraction, and scalar multiplication are collectively called linear operations on vectors.
Fundamental theorem and coordinate representation of planar vectors
Fundamental theorem of planar vectors
The theorem states: If two vectors are not collinear, then there is a unique pair of real numbers such that every vector coplanar with satisfies .
There are so many planar vectors; how can all planar vectors be represented using as few quantities as possible?
It is clearly impossible to represent every vector using only one vector; at most, vectors on a particular line can be represented.
Add another vector and use two non-collinear vectors (the two collinear vectors can be regarded as one vector here). Then any planar vector can be decomposed into the directions of these two vectors.
Two non-collinear vectors in the same plane are called a basis. If the basis vectors are perpendicular to each other, the decomposition is an orthogonal decomposition of the vector.
Coordinate representation of planar vectors
If unit vectors in the directions of the horizontal and vertical axes are chosen as a basis, then by the fundamental theorem of planar vectors, every vector in the plane corresponds bijectively to an ordered pair of real numbers .
An ordered pair of real numbers also corresponds bijectively to a point in the plane's Cartesian coordinate system. Thus, if , the endpoint is uniquely determined. Since the objects under study are free vectors, their starting points may be translated freely; consequently, every vector in the Cartesian plane has a unique representation by an ordered pair of real numbers.
Coordinate operations on planar vectors
Linear operations on planar vectors
The coordinate operations of planar vectors can be derived from their linear operations. The main method is to express all coordinates in terms of the basis vectors, combine them using the operation laws, and then express the result in coordinates.
If two vectors are and , then:
Finding the coordinate representation of a vector
Given two points , it is easy to prove that .
Translating a point
Sometimes a point needs to be translated in a given direction by a certain distance. Combine the direction and distance to form a vector, then use the triangle law of vector addition to add this vector to . The endpoint of the resulting vector is the translated point.
Determining whether three points are collinear
If three points are collinear, then .
Extension of the collinearity criterion for three points
In triangle , if is the -division point of (), then:
Extension to three-dimensional space (solid geometry/spatial vectors)
Everything described above also holds in space. In addition:
Fundamental theorem of spatial vectors
The theorem states: If three vectors are not coplanar, then there is a unique pair of real numbers such that every vector in space satisfies . According to the fundamental theorem of spatial vectors, three mutually perpendicular basis vectors can likewise be used as an orthogonal basis to establish a spatial Cartesian coordinate system, with a triple representing a spatial vector as its coordinates.
Fundamental theorem of coplanar vectors
If there are two non-collinear vectors , then a necessary and sufficient condition for a vector to be coplanar with is that there exist a unique pair of real numbers such that .
Direction vectors
The direction of a spatial line is represented by a nonzero vector parallel to the line; this vector is called a direction vector of the line. The position of a line in space is completely determined by one spatial point through which it passes and one of its direction vectors.
Note that lines in a plane also have direction vectors.
For a line in space, its direction vector can be found as follows:
-
If are given, then a direction vector of the line containing is .
-
If a plane perpendicular to the required line is known and its general equation is , then a direction vector of the line perpendicular to that plane is . This direction vector is also a normal vector of the plane.
Normal vectors
For a face , its normal vector is perpendicular to the face.
To compute it, choose any two lines in the face, , so that and , and calculate using coordinates.
Vectors and matrices
In linear algebra, linear transformations can be represented by matrices. Let be a linear transformation mapping to , and let be an -dimensional column vector. Then there exists an matrix such that
The matrix is called the transformation matrix of the linear transformation . In algorithmic problems, linear transformations generally act within the same dimension, so is a square matrix. Thus, a vector linear-transformation problem can be converted into a matrix multiplication problem.
Next we discuss three transformations that are relatively common in contests and their corresponding transformation matrices: scaling (whose transformation matrix is denoted by ), rotation (denoted by ), and translation (denoted by ).
Scaling transformation
For an -dimensional column vector , scale each dimension by . It is easy to see that the transformation matrix for scaling is an diagonal matrix, namely .
Rotation transformation
Rotation of a vector is a relatively complicated operation, so we restrict the discussion to two and three dimensions.
Rotation of a vector about a point
Rotation of a vector about a point generally means rotation about the origin. To rotate about another point , translate the point to the origin, perform the vector rotation, and then translate the coordinate system back to its original position. Let the transformation matrix for translation be and that for rotation about the origin be . The transformation matrix for the whole process is . By its geometric meaning, necessarily exists.
In two-dimensional space, let have inclination and length . Then . Rotate it counterclockwise about the origin through an angle to obtain .
Using the trigonometric identity,
Simplifying,
Substituting the above back gives
Therefore, in two-dimensional space, the transformation matrix is
In three-dimensional space, vector rotation requires two angular parameters, namely the zenith-angle rotation and the azimuth-angle rotation. The rotation can be performed using spherical coordinates.
Rotation of a vector about a line
For three-dimensional vectors, rotation about a line is more common. For convenience, assume again that this line passes through the origin. If it does not, the coordinate system can still be translated to reduce it to this case.
Take the direction vector of the line to be , and let a three-dimensional vector be rotated counterclockwise about it through an angle . The corresponding transformation matrix is 1
Translation transformation
Translation is not a linear transformation but an affine transformation. However, an affine transformation in can still be represented by a linear transformation in .
Consider an -dimensional vector and translate it along the vector . Append one dimension to the column vector and set it to , obtaining the new column vector . The transformation matrix can then be written as
For any other linear transformation matrix, add one column and one row to the matrix, filling every part with except for the bottom-right element, which is . In this way, every linear transformation matrix can be converted into an affine transformation matrix. For example, for a two-dimensional vector rotation, the transformation matrix becomes
A more rigorous definition of vectors
Above, a vector was defined as a directed line segment in space. Strictly speaking, however, a vector is more than a directed line segment. To give vectors a more rigorous definition, one must first define a vector space; see the vector space page for details.