If we now choose a coordinate system in the plane with as origin, then the parallelogram law in the plane shows that their sum is the diagonal of the parallelogram they determine with tail. This is an intrinsic description of the sum because it makes no reference to coordinates. This discussion proves:. In the parallelogram determined by two vectors and , the vector is the diagonal with the same tail as and. Because a vector can be positioned with its tail at any point, the parallelogram law leads to another way to view vector addition.
Since denotes the vector from a point to a point , the tip-to-tail rule takes the easily remembered form. One reason for the importance of the tip-to-tail rule is that it means two or more vectors can be added by placing them tip-to-tail in sequence. There is a simple geometrical way to visualize the matrix of two vectors.
If and are positioned so that they have a common tail , and if and are their respective tips, then the tip-to-tail rule gives. Hence is the vector from the tip of to the tip of. Thus both and appear as diagonals in the parallelogram determined by and see Figure 4. If and have a common tail, then is the vector from the tip of to the tip of. One of the most useful applications of vector subtraction is that it gives a simple formula for the vector from one point to another, and for the distance between the points.
Let and be two points. The distance between and is , and the vector from to is. The next theorem tells us what happens to the length and direction of a scalar multiple of a given vector.
If a is a real number and is a vector then:. To prove the second statement, let denote the origin in Let have point , and choose any plane containing and. If we set up a coordinate system in this plane with as origin, then so the result follows from the scalar multiple law in the plane. A vector is called a if. Then , , and are unit vectors, called the vectors. If show that is the unique unit vector in the same direction as. Two nonzero vectors are called if they have the same or opposite direction.
Two nonzero vectors and are parallel if and only if one is a scalar multiple of the other. Given points , , , and , determine if and are parallel. By Theorem 4. If then , so and , which is impossible. Hence is a scalar multiple of , so these vectors are not parallel by Theorem 4.
These vector techniques can be used to give a very simple way of describing straight lines in space. In order to do this, we first need a way to specify the orientation of such a line. We call a nonzero vector a direction vector for the line if it is parallel to for some pair of distinct points and on the line.
Note that any nonzero scalar multiple of would also serve as a direction vector of the line. We use the fact that there is exactly one line that passes through a particular point and has a given direction vector. We want to describe this line by giving a condition on , , and that the point lies on this line. Let and denote the vectors of and , respectively. Hence lies on the line if and only if is parallel to —that is, if and only if for some scalar by Theorem 4.
Thus is the vector of a point on the line if and only if for some scalar. The line parallel to through the point with vector is given by. In other words, the point with vector is on this line if and only if a real number t exists such that.
The line through with direction vector is given by. In other words, the point is on this line if and only if a real number exists such that , , and. Find the equations of the line through the points and. Let denote the vector from to. Then is parallel to the line and are on the line , so serves as a direction vector for the line.
Using as the point on the line leads to the parametric equations. Note that if is used rather than , the equations are. These are different from the preceding equations, but this is merely the result of a change of parameter. In fact,. Solution: Suppose with vector lies on both lines.
Hence the lines intersect if and only if the three equations. In this case, and satisfy all three equations, so the lines do intersect and the point of intersection is. Of course, this point can also be found from using. Suppose a point and a plane are given and it is desired to find the point that lies in the plane and is closest to , as shown in Figure 4. Clearly, what is required is to find the line through that is perpendicular to the plane and then to obtain as the point of intersection of this line with the plane.
Finding the line perpendicular to the plane requires a way to determine when two vectors are perpendicular. This can be done using the idea of the dot product of two vectors. Given vectors and , their dot product is a number defined. Because is a number, it is sometimes called the scalar product of and. If and , then.
Let , , and denote vectors in or. Verify that when , , and. There is an intrinsic description of the dot product of two nonzero vectors in. To understand it we require the following result from trigonometry. If a triangle has sides , , and , and if is the interior angle opposite then. We prove it when is acute, that is ; the obtuse case is similar.
The law of cosines follows because for any angle. Now let and be nonzero vectors positioned with a common tail. Then they determine a unique angle in the range. This angle will be called the angle between and. Clearly and are parallel if is either or. Note that we do not define the angle between and if one of these vectors is. The next result gives an easy way to compute the angle between two nonzero vectors using the dot product.
Let and be nonzero vectors. If is the angle between and , then. We calculate in two ways. First apply the law of cosines to the triangle in Figure 4. Comparing these we see that , and the result follows. If and are nonzero vectors, Theorem 4. Moreover, since and are nonzero and are nonzero vectors , it gives a formula for the cosine of the angle :.
Since , this can be used to find. Compute the angle between and. Now recall that and are defined so that , is the point on the unit circle determined by the angle drawn counterclockwise, starting from the positive axis. In the present case, we know that and that. Because , it follows that. If and are nonzero, the previous example shows that has the same sign as , so. In this last case, the nonzero vectors are perpendicular.
The following terminology is used in linear algebra:. Since if either or , we have the following theorem:. Two vectors and are orthogonal if and only if. Show that the points , , and are the vertices of a right triangle. Evidently , so and are orthogonal vectors.
This means sides and are perpendicular—that is, the angle at is a right angle. In applications of vectors, it is frequently useful to write a vector as the sum of two orthogonal vectors.
If a nonzero vector is specified, the key idea is to be able to write an arbitrary vector as a sum of two vectors,. Suppose that and emanate from a common tail see Figure 4. Let be the tip of , and let denote the foot of the perpendicular from to the line through parallel to. Then has the required properties:. The vector in Figure 4. Note that the projection is zero if and only if and are orthogonal. Calculating the projection of on is remarkably easy.
Let and be vectors. The vector is parallel to and so has the form for some scalar. The requirement that and are orthogonal determines. In fact, it means that by Theorem 4.
If is substituted here, the condition is. It follows that , where the assumption that guarantees that. Find the projection of on and express where is parallel to and is orthogonal to.
The projection of on is. Hence , and this is orthogonal to by Theorem 4. Since , we are done. A nonzero vector is called a normal for a plane if it is orthogonal to every vector in the plane.
For example, the unit vector is a normal vector for plane. Given a point and a nonzero vector , there is a unique plane through with normal , shaded in Figure 4. A point lies on this plane if and only if the vector is orthogonal to —that is, if and only if.
Because this gives the following result:. The plane through with normal as a normal vector is given by. In other words, a point is on this plane if and only if , , and satisfy this equation. Find an equation of the plane through with as normal. This simplifies to. If we write , the scalar equation shows that every plane with normal has a linear equation of the form. Conversely, the graph of this equation is a plane with as a normal vector assuming that , , and are not all zero.
Find an equation of the plane through that is parallel to the plane with equation. The plane with equation has normal. Because the two planes are parallel, serves as a normal for the plane we seek, so the equation is for some according to 4. Insisting that lies on the plane determines ; that is,. Hence, the equation is. Consider points and with vectors and. Given a nonzero vector , the scalar equation of the plane through with normal takes the vector form:.
The plane with normal through the point with vector is given by. In other words, the point with vector is on the plane if and only if satisfies this condition.
Every plane with normal has vector equation for some number. Sometimes, when we represent the whole vector as a symbol, we may put an arrow above the symbol in this case v to emphasise that it is a vector. The first form is more convenient when working with matrices, whereas the second form is easier to write in text form. Here ' x ', ' y ' and ' z ' are operators, they can often be used in equations in a similar way to variables but they may have different laws for instance multiplication may not commute.
This can be a conveinent way to encode the laws for combining vectors in conventional looking algebra. We can extend the concept of vectors usually by bolting on extra types of multiplication to add to the built-in addition and scalar multiplication to form more complex mathematical structures, alternatively we might think of vectors as subsets of these structures, for instance:.
What we cannot do is have a vector whose elements are themselves vectors. This is because the elements of the vector must be a mathematical structure known as a ' field ' and a vector is not itself a field because it does not necessarily have commutative multiplication and other properties required for a field. Still it would be nice if we could construct a matrix from a vector drawn as a column whose elements are themselves vectors drawn as a row :. In order to create a matrix by compounding vector like structures we need to do two things to the 'inner vector':.
To do this we create the 'dual' of a vector, this is called a covector as described on this page. This type of multiplication takes one vector and one scalar.
Scalar multiplication multiplies the magnitude of the vector, but does not change its direction, so:. However these linear properties are not enough, on their own, to define the properties of Euclidean space using algebra alone. To be able to define concepts like distance and angle we must define a quadratic structure.
However, we could define an equally valid and consistent vector algebra which squares to a negative number:. We could also define an algebra where we mix the dimensions, some square to positive, some square to negative. An example of this is Einsteinean space-time, space and time dimensions square to different values, if space squares to positive then time squares to negative and visa-versa.
For 3D programming the subject matter of this site we are mainly concerned with vectors of 2 or 3 numbers. A vector of dimension 3 can represent a physical quantity which is directional such as position , velocity , acceleration , force , momentum , etc.
For example if the vector represents a point in space, these 3 numbers represent the position in the x, y and z coordinates see coordinate systems. Where x, y and z are mutually perpendicular axis in some agreed direction and units. A 3 dimensional vector may also represent a displacement in space, such as a translation in some direction. In the case of the Java Vecmath library these are two classes: Point3f and Vector3f both derived from Tuple3f.
Note these use floating point numbers, there are also classes, ending in d, which contain double values.
The Point3f class is used to represent absolute points and the Vector3f class represents displacement. In most cases the behavior of these classes is the same, as far as I know the difference between these classes is when they are transformed by a matrix Point3f will be translated by the matrix but Vector3f wont. Here we are developing the following classes to hold a vector and encapsulate the operations described here,.
It would be possible to build a vector class that could hold a vector of any dimension but a variable dimension class would be less efficient. Since we are concerned with objects in 3D space it is more important to handle 2D and 3D vectors efficiently.
Upto now we have thought of the vector as the position on a 2,3 or n dimensional grid. However for some physical situations there may not be a ready defined Cartesian coordinate system. An alternative might be to represent the vector as a linear combination of 3 basis:.
These basis don't have to be mutually perpendicular although in most cases they probably will be however they do have to be independent of each other, in other words they should not be parallel to each other and all 3 should not be in the same plane.
So a vector in 3 dimensions can be represented by [a,b,c] where a,b and c represent the scaling of the 3 basis to make the vector as follows:. Note that if this vector represents position then it will be a relative position, i. So the problem remains of how to define the basis, there may be some natural definition of these in the problem domain.
0コメント