Definitions and concepts
A vector is a directional line that is defined 2 coordinates.
Multiplying a vector by a number k
is changing its length by k
times. When \(k < 0\) the vector will expand.
The length of a vector is calculated by the formula \(\sqrt {x^2 + y^2} \).
Normalized vector
- a vector of unit length, obtained by dividing a vector by its length.
The sum of vectors is obtained by constructing a second vector from the end of the first, and putting the vector into the resulting point.
If x1
, y1
, x 2
, y2
- coordinates of the first and second vectors, respectively, then their sum is a vector with coordinates \((x_1 + x_2) \)and \((y_1 + y_2) \).
Vector difference - the sum where the second vector is reversed (multiplied by -1).
Dot product of vectors - number, projection of one vector onto another multiplied by its length. In the simplest case of ordinary Euclidean space, "geometric" space is sometimes used. definition of the scalar product of non-zero vectors a
and b
as the product of the lengths of these vectors and the cosine of the angle between them:
\(a \cdot b = |a| \cdot |b| \cdot cos \alpha\).
For the dot product by a vector, the following formula holds true:
\(a \cdot b = x_1 \cdot x_2 + y_1 \cdot y_2\),
where x1
, y1
, x2
, y2
- coordinates of the first and second vector, respectively, allows you to determine whether the second vector lies in the same half-plane as the first one.
Cross product of vectors - a vector in three-dimensional space perpendicular to both vectors, equal in length to the oriented area of the parallelogram built on these vectors. The product of the lengths of the vectors by the sine of the angle between them, and the sign of this sine depends on the order of the operands: alpha\)
If calculated using coordinates:
\(a\ x\ b = x_1 \cdot y_2 + x_2 \cdot y_1\),
where x1
, y1
, x2
, y2
- coordinates of the first and second vector, respectively, allows you to determine which side of the line on which the first vector lies, the second vector is located. Also allows you to find the oriented area of triangles and parallelograms.
The rotation of a vector
is performed using the black magic of the secret adepts of Lobachevsky geometry.
To rotate a vector by \(\alpha\) counterclockwise (\(\alpha <= 2 \cdot \ pi\), get used to the angles in radians), you need to multiply the vector by this matrix:
\(\begin{bmatrix} \cos \alpha & -sin \alpha \\ \sin \alpha & cos \alpha \end{bmatrix}\)< /p>
What does it mean to multiply a vector by a matrix? Let's say the coordinates of our vector are x
and y
, then the product of this vector and our matrix will be equal to the vector with the coordinates x'
and y'
:
\(x' = x \cdot cos \alpha - y \cdot sin \alpha \\ y' = x \cdot sin \alpha + y \cdot cos\alpha\) span>
So we get a new vector of exactly the same length, but already rotated by angle A counterclockwise.