English 中文(简体)
vectors vs. vector graphics
原标题:

What (if any) is the relationship between vectors used in programming languages (e.g. arrays) and vector graphics?

Why do they share the term vector? Does it represent some analogous aspect of their nature or is it coincidence?

When thinking about it, a bitmap image would fit the term vector graphic better since it s represented by an array of pixels..

问题回答

a vector is a set of values, which "normally" (mathematicians would kill me) represent the coefficients of a linear combination of things (functions, or other vectors).

For example, when you say

[4, 3, 7]

and your basis is the set of power exponents of x (i.e. 1, x, x^2, x^3 etc...), this vector expresses the polynom

4 + 3x + 7 x^2

if you use a different basis, for example arbitrary directions in 3d space, that same vector expresses a direction in 3d space.

4i + 3j + 7k

(lateral consideration: please note that 3d space is a finite vectorial space of dimension 3, while the polynomial space is an infinite vectorial space, or a Hilbert space as it is better defined)

This is a vector (think an arrow) pointing in a specific direction in space, from an origin to an end. The convention is that i,j, and k are the so called basis set vectors of the 3d vectorial space, where the coordinates of each point are expressed as x,y and z. In other words, every point in space, and every direction in space, can be expressed with a triple of numbers (a vector) x, y, z which represents the spatial vector x * i + y * j + z * k.

In vector graphics, you express graphical entities not as a grid of pixel (raster graphics) but as mathematical formulas. A curve is described as a parametrized mathematical expression. This opens up a lot of nice properties for displaying, because a mathematical description has basically infinite resolution. You can also apply mathematical transformation on these entities, like rotation, without ruining its description, and these transformations are deeply rooted in linear algebra, the discipline governing transformation of vectorial spaces, matrices and so on...

They share a root meaning in mathematics.

The graphics meaning (a continuously valued offset from on arbitrary position in space), derives from the fact that you use mathematical vectors to represent it (e.g. one to represent the starting point and to represent the offset).

The programming language meaning (an ordered set of numbers) is one way of writing down the mathematical version.

A vector is an ordered group of values, such as <1, 2, 3>. It is different to an array because it is a fixed size and represents a number of values and their position in the vector is significant. An array is just an ordered collection of things. The order of elements matters but not their position. The things in it are generally all of the same type.

If the vector represented <# apples, # oranges, # pears> then it could be interpreted as <1 apple, 2 oranges, 3 pears>. If it represented <X position, Y position, Z position> then the above might mean <1 in the X axis, 2 in the Y axiz, 3 in the Z axis> (a Euclidean vector). Thus vectors can represent co-ordinates in arbitrary dimensions and are used to store information in vector graphics.

I guess it comes from the mathematical term vector , which is a geometrical concept. When you operate on mathematical vectors, which (in theory) have their values in continuous domains, instead of on discrete pixels, you can compute with arbitrary precision. In a graphics application, it means that you can retain precise point positions regardless of the zoom factor you are displaying your picture at.

Vector graphic is different that normal graphic because it can be zoomed without aliasing. It is called vector graphic because each line or other object are represented by a vector instead of the "by pixel" normal grahic.





相关问题
vectors vs. vector graphics

What (if any) is the relationship between vectors used in programming languages (e.g. arrays) and vector graphics? Why do they share the term vector? Does it represent some analogous aspect of their ...

MVC and Property Terminology in Objective-C

I am having a problem with terminology I think. Is a ViewController the Controller portion of MVC? Or is it not the same thing. Is this combining the VC of MVC into one file? Properties like ....

Origin of "map" in Computer Science

In computer science, there are two definitions of the word map. The first is as an associative array, a type of container that maps values of one type to values of another type. An example of this is ...

Definition of the word "patch"

Personally, I use the word "patch" as the software equivalent of a symptomatic treatment, which makes a patch a quick-and-dirty bugfix. However, I m not sure this is correct, because I often see it is ...

What is Facet in JavaEE?

I wonder not only what is Facet but also what is Facet in physical level (as I understand it s not a separate jar, but what?)? I also wonder how can it affect my application after deploying. I ll ...

What is the meaning of "POSIX"?

What is POSIX? I have read the Wikipedia article and I read it every time I encounter the term. The fact is that I never really understood what it is. Can anyone please explain it to me by explaining ...

Term for rotating header

I m looking for terminology that describes this behavior: The header of a web-page contains a different image every time you visit it. Update: It is not an advertisement, but images related to the ...

热门标签