|
What is Vector? |
Mathematically, a vector is a quantity, defined by both magnitude and direction. For example, one vector could be illustrated by an 1 inch arrow pointing at a 30 degree angle. Another vector may be 2.5 inches and point at 160 degree angle. In the computer world, vectors are used to define paths in certain types of images, such as EPS files and Adobe Illustrator documents. These images are often called vector graphics since they are comprised of vectors, or paths, instead of dots. Vector graphics can be scaled larger or smaller without losing quality.
In computer science, a vector can also be used to refer to one dimensional array. For example, a vector called "fibonacci" that stores the first six values of the Fibonacci sequence would be defined as follows:
fibonacci[0] = 0, fibonacci[1] = 1, fibonacci[2] = 1, fibonacci[3] = 2, fibonacci[4] = 3, fibonacci[5] = 5
Still, most people refer to a one-dimensional array simply as an "array." But using the term "vector" does sound a bit more cool. |
|
|
|