.

Vectors Assignment Help

Vectors

A vector is a ray with both magnitude (size) and direction. A vector is different from a scalar in that a scalar has only magnitude. For example, speed is a scalar quantity, but velocity is a vector, because it gives both speed and direction. Vectors are used to show directed quantities and can be thought of as the motion necessary to get from one point to another. Vectors are typically written as a, or vectors image 1. In two-dimensional Cartesian space, a vector has the form vectors image 2. A unit vector is a vector with a magnitude of 1 and is written as vectors image 3. Any vector can be made into a unit vector in the form 

vectors image 4,

where vectors image 5

represents the vector's magnitude.

What is Implementing Vectors?

One of the major drawbacks to conventional arrays is that their size cannot be changed. Items cannot be easily added to the end or inserted in the middle. Creating a vector is one of the simplest solutions to this problem. A vector classNameoften acts as a wrapper for conventional arrays. Internally a vector usually an array which acts as a buffer. When you want to add an element to a vector it appends it to the next available spot on its internal array. When the internal array is full the vector will create a new larger one and copy the data into it. Essentially the purpose of creating a vector is to simulate an array with more capability which the end user does not need to be directly concerned with. There are some drawbacks, however. For instance, copying large arrays can be inefficient as well as inserting in the middle of an arrays since all values will need to be shifted. Before choosing a vector the requirements of a problem should be carefully examined to see if it is the ideal data structure.

horizontal and vertical components

horizontal component Ax =A cosθ

vertical component Ay = A sinθ

A is the hypotenuse of the right triangle.

vectors image 6

Sum of two vectors which is given below by the picture.

vectors image 7

Example:

vectors image 8
.