Scalar vectors. Vectors in computer games

VECTORS. ACTIONSABOVEVECTORS. SCALAR,

VECTOR, MIXED PRODUCT OF VECTORS.

1. VECTORS, ACTIONS ON VECTORS.

Basic definitions.

Definition 1. A quantity that is fully characterized by its numerical value in the chosen system of units is called scalar or scalar .

(Body weight, volume, time, etc.)

Definition 2. A quantity characterized by a numerical value and direction is called vector or vector .

(Move, power, speed, etc.)

Designations:, or ,.

The geometric vector is a directed cut.

For vector - point A- start point V is the end of the vector.

Definition 3.Module Vector - This is the length of the ab.

Definition 4. Vector, the module of which is zero, is called zero , denotes.

Definition 5. Vectors located on parallel straight lines or on one direct called collinear . If two Collinear vectors have the same direction, then they are called Sonated .

Definition 6. Two vectors are considered equal , if they Soncedated And equal in the module.

Actions on vectors.

1) Addition of vectors.

Def. 6.sum Two vectors and is a diagonal of a parallelogram built on these vectors, outgoing from the total point of their application (rule parallelogram).

Fig.1.

Def. 7. Summaterech vectors, called diagonal of parallelepiped, built on these vectors (parallelepiped rule).

Def. eight. If A, V, WITH - arbitrary points, then + = (triangle rule).

fig.2

Addition properties.

1 O . + = + (displacement law).

2 O . + (+) = (+) + = (+) + (combinated law).

3 O . + (– ) + .

2) subtraction of vectors.

Def. 9. Under difference vectors and understand vector = - such that + = .

In the parallelogram - is another diagonal SD (see cris 1).

3) vector multiplication by number.

Def. 10. work Vector on scalar k called vector

= k = k ,

Long ka , and the direction that:

1. Coincides with the direction of the vector if k > 0;

2. opposite the direction of the vector if k < 0;

3. arbitrarily if k = 0.

Vector multiplication properties by number.

1 O . (k + l ) = k + l .

k ( + ) = k + k .

2 o . k (l ) = (kl ) .

3 o . 1 = , (–1) = – , 0 = .

Vector properties.

Def. eleven. Two vectors and are called collinear if they are located on Parallel straight lines or at One straight line.

Zero vector collinear in any vector.

Theorem 1. Two nonzero vector and collinear,  When they are proportional to those.

= k , k - scalar.

Def. 12. Three vectors, called coplanar If they are parallel to some plane or lie in it.

Theorem 2. Three nonzero vector ,, coplanar,  when one of them is a linear combination of the other two, i.e.

= k + l , k , l - scalars.

Projection of a vector onto an axis.

Theorem 3. Projection of a vector onto an axis (directed line) l equal to the product of the length of the vector on the cosine of the angle between the direction of the vector and the axis direction, i.e. = a c os , = ( , l).

2. Coordinates of the vector

Def. thirteen. Vector projections on coordinate axes Oh, OU, Oz called vector coordinates. Designation:  a x , a y , a z .

Vector length:

Example: Calculate the length of the vector .

Solution:

Distance between points and calculated by the formula: .

Example: Find the distance between points M (2,3,-1) and K (4,5,2).

Actions on vectors in coordinate form.

Vectors are given =  a x , a y , a z and = b x , b y , b z .

1. (  )= a x b x , a y b y , a z b z .

2. = a x , a y , a z, where - scalar.

Scalar product of vectors.

Definition: Under the scalar product of two vectors and

number is understood equal to the product the lengths of these vectors by the cosine of the angle between them, i.e. = , - The angle between the vectors and.

Properties of a scalar piece:

1. =

2. ( + ) =

3.

4.

5. where - scalars.

6. two vectors are perpendicular (orthogonal) if .

7. Then and only when .

The scalar product in coordinate form has the form: , where and .

Example: Find the scalar product of vectors and

Solution:

Vector holding vectors.

Definition: Under the vector product of two vectors and is understood as the vector for which:

The module is equal to the parallelogram area built on the data of the vector, i.e. , where is the angle between the vectors and

This vector is perpendicular to the multiplied vectors, i.e.

If the vectors are non-collinear, then they form a right triple of vectors.

Cross product properties:

1. When changing the order of the factory, the vector product changes its sign to the reverse, saving the module, i.e.

2 .Vector square is zero-vector, i.e.

3 .The scalar factor can be taken out of the sign of the vector product, i.e.

4 . For any three vectors fair equality

5 .Necessary and sufficient condition for the collinearity of two vectors and :

Vector work in coordinate form.

If the coordinates of the vectors and , then their vector product is found by the formula:

.

Then from the definition of a cross product it follows that the area of ​​a parallelogram built on vectors and is calculated by the formula:

Example: Calculate the area of ​​a triangle with vertices (1;-1;2), (5;-6;2), (1;3;-1).

Solution: .

Then the area triangle ABC will be calculated as follows:

,

Mixed vectors.

Definition: Mixed (vectorly scalar) works of vectors called the number determined by the formula: .

Properties of mixed work:

1. The mixed product does not change in the cyclic permutation of his factors, i.e. .

2. When permuting two neighboring buildings, a mixed work changes his sign to the opposite, i.e. .

3 . Audible and sufficient condition for the compartment of three vectors : =0.

4 . A mixedwork of three vectors is equal to the volume of parallelepiped, built on these vectors taken with a plus sign, if these vectors form the right three, and with a minus sign, if they form the left three, i.e. .

If known coordinates vectors , That mixed work is located by the formula:

Example: Calculate a mixed product of vectors.

Solution:

3. Base of vectors system.

Definition. Under the system of vectors understand several vectors belonging to the same space R.

Comment. If the system consists of a finite number of vectors, they are denoted by the same letter with different indices.

Example.

Definition. Any vector type = called a linear combination of vectors. Numbers - linear combination coefficients.

Example. .

Definition. If the vector is a linear combination of vectors , That they say that the vector is linearly expressed through vectors .

Definition. The system of vectors is called Linear independent If no system system can be as a linear combination of the remaining vectors. Otherwise, the system is called linearly dependent.

Example. System vectors linearly dependent, since vector .

Definition of the basis. The system of vectors forms a basis if:

1) it is linearly independent

2) Any space of space through it is linearly expressed.

Example 1 Base space :.

2. In system vectors vectors are the basis: , because linearly expressed through vectors.

Comment. To find the basis of this vectors system you need:

1) write the coordinates of the vectors in the matrix,

2) using elementary transformations to bring the matrix to the triangular form

3) The non-zero lines of the matrix will be the basis of the system,

4) The number of vectors in the base is equal to the wage of the matrix.

Creation date: 2009-04-11 15:25:51
Last edited: 2012-02-08 09:19:45

For a long time I did not want to write this article - I thought how to serve the material. You also need to draw pictures. But, the stars and article about the vectors are successful today. Although it is just a rough version. In the future, this article by separation into several separate - material is enough. Also, gradually the article will improve: I will make changes to it - because For one Single, it will not be possible to reveal all aspects.

The vectors were introduced into mathematics in the nineteenth century, to describe the values ​​that were difficult to describe with the help of scalar values.

Vectors are intensively used in the development of computer games. They are used not only traditionally - to describe such values ​​as power or speed, but also in areas that seemed to be in no way connected with vectors: color storage, shadow creation.

Scalars and vectors

To begin with, I remind you that such a scalar is, and what it differs from the vector.

Scalar values ​​store some value: mass, volume. That is, this is the essence, which is characterized by only one number (for example, the number of something).

The vector, unlike the Scalar, is described using two values: the value and direction.

An important difference of vectors from coordinates: vectors are not tied to a specific location! I repeat once again, the main thing in the vector is the length and direction.

The vector is denoted by the fat letter of the Latin alphabet. For instance: a, b, v.

In the first figure, you can see how the vector is denoted on the plane.

Vectors in space

In space, vectors can be expressed using coordinates. But before you need to introduce one thing:

Radius

Let's take some point M(2,1) in space. Radius-vector point is a vector starting at the beginning of the coordinates and ending at the point.

We have no one like a vector OM. Coordinates of the beginning of the vector (0.0), the coordinates of the end (2,1). Let's denote this vector as a.

In this case, the vector can be written as follows. a = <2, 1>. This is the coordinate form of the vector a.

Vector coordinates are called its components relative to the axes. For example, 2 is a vector component a Regarding the x axis.

Let's once again dwell on what the coordinates of a point are. The point coordinate (for example, X) is the projection of the point on the axis, i.e. The base of the perpendicular, lowered from the point on the axis. In our example 2.

But back to the first picture. We have two points a and b. Let the coordinates of the points (1,1) and (3.3). Vector v In this case, you can designate so v = <3-1, 3-1>. A vector lying at two points in three-dimensional space will look like this:

v =

I don't think there are any problems here.

Multiplication of vector on scalar

The vector can be multiplied by scalar values:

k v = =

In this case, the scalar value is multiplied with each component of the vector.

If k> 1, the vector will increase if K is less than one, but more zero - the vector will decrease in length. If K is less than zero, the vector will change the direction.

Single vectors

Single vectors are vectors of which is equal to one. Note, vector with coordinates<1,1,1>It will not be equal to one! Finding the length of the vector is described below in the text.

There are so-called orts - these are single vectors that coincide with the coordinate axes. i- unit vector of the x axis, j- ORT axis Y, k- ort axis z.

Wherein i = <1,0,0>, j = <0,1,0>, k = <0,0,1>.

Now we know that such a multiplication of the vector on the scalar and what is single vectors. Now we can record v in vector form.

v= V X. i+ V y. j+ V Z. k where V x, V y, V z is the corresponding components of the vector

Addition of vectors

To fully understand the previous formula, it is necessary to understand how the addition of vectors works.

Everything is simple here. Take two vectors v1 = and V 2 =

V 1 + V 2 =

We just fold the corresponding components of two vectors.

The difference is calculated in the same way.

This regarding mathematical form. For completeness, it is worth considering how the addition and subtraction of the vectors will look graphically.


In order to fold two vector a+b. Need to combine the beginning of the vector b and the end of the vector a. Then, between the beginning of the vector a And the end of the vector b Hold a new vector. For clarity, see the second drawing (letter "A").

To subtract vectors, you need to combine the beginning of two vectors and spend a new vector from the end of the second vector by the end of the first one. In the second figure (letter "B") shown as it looks.

Length and direction vector

First consider the length.

Length is a numeric value of the vector, excluding the direction.

Length is determined by the formula (for three-dimensional vector):

Square root of squares summons. Vector component.

Familiar formula, isn't it? In general, this is a segment length formula

The direction of the vector is determined by the guide cosines of the angles formed between the vector and axes of coordinates. To find the guide cosines, appropriate components and length are used (the picture will be later).

Presentation of vectors in programs

Present vectors in programs in various ways. Both with the help of conventional variables, which is not efficient and with the help of arrays, classes and structures.

Float vector3 = (1,2,3); // Array Struct Struct Vector3 // Storage Structure (Float X, Y, Z;);

Classes are provided with the greatest opportunities when storing vectors. In classes, we can describe not only the vector (variables), but also vector operations (functions).

Scalar product vectors

There are two types of vector multiplication: vector and scalar.

A distinctive feature of a scalar product - as a result will always be a scalar meaning, i.e. number.

It is worth paying attention to what moment. If the result of this operation is zero, it means that two vectors are perpendicular to the angle between them 90 degrees. If the result is greater than zero, the angle is less than 90 degrees. If the result is less than zero, an angle is more than 90 degrees.

This operation is the following formula:

a · b= a x * b x + a y * b y + a z * b z

The scalar product is the amount of works of the corresponding components of two vectors. Those. We take x "s of two vectors, multiply them, then add them to the product of y" s and so on.

Vector artwork vectors

The result of a vector product of two vectors will be vector perpendicular to these vectors.

a x b =

We will not discuss this formula in detail yet. In addition, it is quite difficult for memorization. We will come back at this point after familiarizing with the determinants.

Well, for general development it is useful to know that the length of the resulting vector is equal to the square of the parallelogram built in vectors a and b.

Normalization of vector

A normalized vector is a vector whose length is one.

The formula for finding the normalized vector is the following - all components of the vector must be divided by its length:

v n = v/ | V | =

Afterword

As you probably have been convinced, the vectors are not complex for understanding. We looked at a number of operations over vectors.

In the following articles of the "mathematics" section, we will discuss matrices, determinants, systems of linear equations. This is the whole theory.

After that, we will look at the conversion of matrices. It was then that you will understand how important mathematics in creating computer games is. This topic will be practiced on all previous topics.

Such a concept as a vector is considered in almost all natural sciences, and it can have completely different meanings, so it is impossible to give an unambiguous definition of a vector for all areas. But let's try to figure it out. So, vector - what is it?

The concept of a vector in classical geometry

The vector in geometry is a segment for which it is indicated which out of its points is the beginning, and which is the end. That is, speaking easier, the vector is called a directional cut.

Accordingly, a vector is indicated (what it is - discussed above), as well as a segment, that is, two capital letters of the Latin alphabet with the addition of a line or an arrow pointing to the right on top. It can also be signed with a lowercase (small) letter of the Latin alphabet with a dash or an arrow. The arrow always points to the right and does not change depending on the position of the vector.

Thus, the vector has a direction and length.

In the designation of the vector also contains its direction. It is expressed as in the figure below.

The change in the direction changes the value of the vector to the opposite.

The vector length is called the length of the segment from which it is formed. It is indicated as a module from the vector. This is shown in the figure below.

Accordingly, zero is a vector whose length is equal to zero. It follows from this that the zero vector is a point, and the points of the beginning and end coincide in it.

Vector length - the value is always not negative. In other words, if there is a segment, then it necessarily has a certain length or is a point, then its length is zero.

The very concept of point is basic and definition has no.

Addition of vectors

There are special formulas and rules for vectors with which you can perform addition.

Triangle rule. To add vectors to this rule, it is enough to combine the end of the first vector and started the second, using the parallel transfer, and connect them. The resulting third vector and will be equal to the addition of the other two.

Rule parallelogram. To add according to this rule, you need to draw both vectors from one point, and then draw another vector from the end of each of them. That is, from the first vector will be held second, and from the second one. As a result, a new intersection point will be obtained and a parallelogram is formed. If you combine the intersection point of the starts and the ends of the vectors, the resulting vector and the result of the addition.

Through it is possible to perform and subtract.

Value difference

Similar to the addition of vectors it is possible to perform their subtraction. It is based on the principle shown in the figure below.

That is, the subtracted vector is enough to imagine in the form of a vector, to him the opposite, and make calculation according to the principles of addition.

Also, absolutely any nonzero vector can be multiplied by any number k, it will change its length in K times.

In addition to these, there are other formulas for vectors (for example, to express the vector length through its coordinates).

Location vectors

Surely many have come across such a concept as a collinear vector. What is collinearity?

Collinearity vectors - equivalent of direct parallelism. If two vectors lie on lines that are parallel to each other, or on the same line, then such vectors are called collinear.

Direction. Regarding each other, collinear vectors can be coinled or oppositely directed, this is determined by the vectors. Accordingly, if the vector is co-directed with another, then the vector, the opposite, is oppositely directed.

The first figure shows two oppositely directed vector and the third, which is not collinear them.

After the introduction of the above properties, it is possible to define and equal to vectors are vectors that are directed in one direction and have the same length of the segments from which they are formed.

In many sciences, the concept of radius-vector is also applied. A similar vector describes the position of one point of the plane relative to another fixed point (often the origin of the coordinates).

Vectors in physics

Suppose, when solving the problem, a condition arose: the body moves at a speed of 3 m / s. This means that the body moves with a specific direction on one straight line, so this variable will be the magnitude of the vector. To solve, it is important to know and value, and direction, since, depending on the consideration, the speed can be equal to 3 m / c, and -3 m / s.

In general, the vector in physics is used to indicate the direction of force acting on the body and to determine the resultant.

When specifying these forces in the figure, they are denoted by arrows with the signature of the vector above it. Classically the length of the arrows is as important, with the help of it indicate which force acts stronger, but this property is not worth relying on it.

Vector in linear algebra and mathematical analysis

The elements of linear spaces are also called vectors, but in this case they represent an ordered system of numbers describing some of the elements. Therefore, the direction in this case has no importance. The definition of a vector in classical geometry and in mathematical analysis are very different.

Projecting vectors

Spriesed vector - What is?

Quite often, for the correct and convenient calculation, it is necessary to decompose the vector located in two-dimensional or three-dimensional space, along the coordinate axes. This operation is necessary, for example, in mechanics when calculating the forces acting on the body. The vector in physics is used quite often.

To perform the projection, it suffices to find the perpendicular from the beginning and end of the vector to each of the coordinate axes obtained on them segments and will be called the projection of the vector on the axis.

To calculate the length of the projection, it is sufficient to multiply its initial length to a certain trigonometric function which is obtained by solving a mini-task. In fact, there is a right triangle in which the hypotenuse is the original vector, one of the legs is the projection, and the other leg is the dropped perpendicular.

DEFINITION

Vector(from lat. " Vector"-" carrier ") - directed cut line in space or on a plane.

Graphically vector is depicted in the form of a directed section of a direct length. The vector whose beginning is at the point and the end at the point is denoted as (Fig. 1). Also, the vector can be denoted by one small letter, for example.

If a coordinate system is given in space, then the vector can be uniquely specified by a set of its coordinates. That is, a vector is understood as an object that has a value (length), direction and application point (beginning of the vector).

The beginning of the vector calculus appeared in the works in 1831 in the works of German mathematics, mechanics, physics, astronomer and geodesist Johanna Charles Friedrich Gauss (1777-1855). Works dedicated to operations with vectors published Irish mathematician, mechanic and physicist theoretics, Sir William Rowan Hamilton (1805-1865) as part of its quaternion calculus. The scientist proposed the term "vector" and described some operations on vectors. Vector calculus received its further development thanks to the work on electromagnetism of the British physicist, mathematician and mechanic James Clerk Maxwell (1831-1879). In the 1880s, I saw the light of the Book "Elements of Vector Analysis" of American Physics, Physicochemistry, Mathematics and Mechanics Josayia Willrd Gibbs (1839-1903). Modern vector analysis was described in 1903 by the English self-taught scientist, engineer, mathematician and physicist Oliver Heaviside (1850-1925).

DEFINITION

Lena or module vector Called the length of the directional segment determining the vector. Denotes how.

Main types of vectors

Zero vector The vector is called the starting point and the end point coincide. The length of the null vector is zero.

Vector parallel to one straight or lying on one straight, called collinear(Fig. 2).

Sonated If their directions coincide.

Figure 2 is vectors and. The system of vectors is indicated as follows :.

Two collinear vectors are called oppositely directed if their directions are opposite.

Figure 3 is vectors and. Designation :.

Page 1 of 2

Question 1. What is a vector? How are the vectors designate?
Answer. Vector we will call a directional segment (Fig. 211). The direction of the vector is determined by the indication of its beginning and end. In the drawing, the direction of the vector is marked with an arrow. To designate vectors, we will use lowercase Latin letters a, b, c, ... . You can also designate a vector by specifying its start and end. In this case, the beginning of the vector is placed in the first place. Instead of the word "vector", an arrow or a dash is sometimes placed above the letter designation of the vector. The vector in Figure 211 can be denoted as follows:

\ (\ Overline (a) \), \ (\ Overrightarrow (a) \) or \ (\ Overline (AB) \), \ (\ Overrightarrow (AB) \).

Question 2. What vectors are called equally directed (oppositely directed)?
Answer. The vectors \(\overline(AB)\) and \(\overline(CD)\) are said to be equally directed if the half-lines AB and CD are equally directed.
The vectors \(\overline(AB)\) and \(\overline(CD)\) are called oppositely directed if the half-lines AB and CD are oppositely directed.
In Figure 212, the vectors \(\overline(a)\) and \(\overline(b)\) have the same direction, while the vectors \(\overline(a)\) and \(\overline(c)\) have opposite directions.

Question 3. What is the absolute value of a vector?
Answer. The absolute value (or modulus) of a vector is the length of the segment representing the vector. The absolute value of the vector \(\overline(a)\) is denoted by |\(\overline(a)\)|.

Question 4. What is a zero vector?
Answer. The beginning of a vector can coincide with its end. Such a vector will be called a zero vector. The zero vector is denoted by zero with a screenshot (\ (\ overline (0) \)). No one talks about the direction of the zero vector. The absolute value of the zero vector is considered equal to zero.

Question 5. What vectors are called equal?
Answer. Two vectors are said to be equal if they are combined by a parallel translation. This means that there is a parallel transfer that translates the beginning and end of a single vector according to the beginning and end of another vector.

Question 6. Prove that equal vectors have the same direction and are equal in absolute value. And back: equally directed vectors equal in absolute value are equal.
Answer. With parallel transfer, the vector retains its direction, as well as its absolute value. This means that equal vectors have the same direction and are equal in absolute value.
Let \(\overline(AB)\) and \(\overline(CD)\) be equally directed vectors equal in absolute value (Fig. 213). A parallel translation that takes point C to point A combines half-line CD with half-line AB, since they are equally directed. And since the segments AB and CD are equal, then the point D coincides with the point B, i.e. parallel translation translates the vector \(\overline(CD)\) into the vector \(\overline(AB)\). Hence, the vectors \(\overline(AB)\) and \(\overline(CD)\) are equal, as required.

Question 7. Prove that from any point one can draw a vector equal to the given vector, and only one.
Answer. Let CD be a line and the vector \(\overline(CD)\) be a part of line CD. Let AB be the line into which the line CD goes during parallel translation, \(\overline(AB)\) be the vector into which the vector \(\overline(CD)\) goes into during parallel translation, and hence the vectors \(\ overline(AB)\) and \(\overline(CD)\) are equal, and lines AB and CD are parallel (see Fig. 213). As we know, through a point not lying on a given line, it is possible to draw on the plane at most one line parallel to the given one (the axiom of parallel lines). Hence, through the point A one can draw one line parallel to the line CD. Since the vector \(\overline(AB)\) is part of the line AB, it is possible to draw one vector \(\overline(AB)\) through the point A, which is equal to the vector \(\overline(CD)\).

Question 8. What are vector coordinates? What is the absolute value of the vector with coordinates a 1 , a 2 ?
Answer. Let the vector \(\overline(a)\) start at point A 1 (x 1 ; y 1) and end at point A 2 (x 2 ; y 2). The coordinates of the vector \(\overline(a)\) will be the numbers a 1 = x 2 - x 1 , a 2 = y 2 - y 1 . We will put the vector coordinates next to the letter designation of the vector, in this case \(\overline(a)\) (a 1 ; a 2) or just \((\overline(a 1 ; a 2 ))\). The zero vector coordinates are equal to zero.
From the formula expressing the distance between two points in terms of their coordinates, it follows that the absolute value of the vector with coordinates a 1 , a 2 is \(\sqrt(a^2 1 + a^2 2 )\).

Question 9. Prove that equal vectors have respectively equal coordinates, and vectors with respectively equal coordinates are equal.
Answer. Let A 1 (x 1 ; y 1) and A 2 (x 2 ; y 2) be the beginning and end of the vector \(\overline(a)\). Since the vector \(\overline(a")\) equal to it is obtained from the vector \(\overline(a)\) by parallel translation, then its beginning and end will be respectively A" 1 (x 1 + c; y 1 + d ), A" 2 (x 2 + c; y 2 ​​+ d). This shows that both vectors \(\overline(a)\) and \(\overline(a")\) have the same coordinates: x 2 - x 1 , y 2 - y 1 .
Let us now prove the converse assertion. Let the corresponding coordinates of the vectors \(\overline(A 1 A 2 )\) and \(\overline(A" 1 A" 2 )\) be equal. We prove that the vectors are equal.
Let x" 1 and y" 1 be the coordinates of the point A" 1, and x" 2, y" 2 be the coordinates of the point A" 2. By the condition of the theorem x 2 - x 1 \u003d x "2 - x" 1, y 2 - y 1 \u003d y "2 - y" 1. Hence x "2 = x 2 + x" 1 - x 1, y" 2 = y 2 + y" 1 - y 1. Parallel translation given by formulas

x" = x + x" 1 - x 1, y" = y + y" 1 - y 1,

transfers point A 1 to point A" 1 , and point A 2 to point A" 2 , i.e. the vectors \(\overline(A 1 A 2 )\) and \(\overline(A" 1 A" 2 )\) are equal, as required.

Question 10. Define the sum of vectors.
Answer. The sum of the vectors \(\overline(a)\) and \(\overline(b)\) with coordinates a 1 , a 2 and b 1 , b 2 is the vector \(\overline(c)\) with coordinates a 1 + b 1 , a 2 + ba 2 , i.e.

\(\overline(a) (a 1 ; a 2) + \overline(b)(b 1 ; b 2) = \overline(c) (a 1 + b 1 ; a 2 + b 2)\).