Vector (data type)
From DmWiki
In C++, Java, and other languages, a vector is a data structure similiar to an array, but which can be resized while the program is running.
However, if you are dealing with Graphics, Vectors are often used to represent the data structure for vertices, normals and color values. This representation is nothing but a structure or an Array of values.
for eg: A Vector Point
struct Vector
{
float x;
float y;
float z;
}
or
typedef float Vector[3]
similarly, a vector Color
struct Color
{
float red;
float green;
float blue;
float alpha;
}
Why do we need to represent these values in the form of a vector or array? It is mainly to allow efficient processing of these values during transformations.
One must be familiar with Linear Algebra basics to fully utilize the power of vectors. They make the implementation of operations such as Cross Products, Dot Products, Inner Products, Transformations very easy to implement.
Another important type of Vectors are the STL Vector containers. More information will be added some.
This article is a stub. You can help improve the article by expanding it.
