vector

Started by
9 comments, last by WildFire- 18 years, 9 months ago
can someone kindly explain how a vector can be a direction, i don't grasp the concept so to speak.
www.cobra-designz.net | Currently under development
Advertisement
If you have a vector like (1,2) then the direction of the vector is like if you were to draw an arrow from (0,0) to (1,2) with the point of the arrow at (1,2).
A vector is like a ray starting at the origin. Its direction is defined by its components. It "points" from the origin to the location held in the vector.

(0, 0, 0) -> (0, 1, 0) points down the positive X axis.
Ra
By convention though, a direction vector has a magnitude of 1. So strictly speaking, (1,2) isn't a direction.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Fair enough, but just to be clear, the vector (1,2) has a direction even though it may not technically be a direction vector.
Vectors seem to hold different meanings depending on who are you talking to. A mathematician might tell you that a vector is a 1-dimensional matrix of any length. A physicist (I almost typed physician) might tell you that a vector is a distance and direction. A programmer might tell you that a vector can be both a point and a distance+direction all at the same time in any dimension. But as bad as that sounds, it's not that complicated.

If you have a vector in a 2D coordinate system, a programmer will often define it as having two components - X and Y. X and Y may represent a point in the coordinate plane or a distance and direction from the origin to that point. This direction is all relative so moving a point in a specific direction simply becomes a matter of adding two vectors.
....[size="1"]Brent Gunning
In terms of pure mathematics, a vector is nothing more than a list of numbers, and is in that sense somewhat analogous to an array in programming.

However, such a strict interpretation of the term yields little use.

From 3D Math Primer for Graphics and Game Development:

" Geometrically speaking, a vector is a directed line segment that has magnitude and direction.

- The magnitude of a vector is the length of the vector. A vector may have any nonnegative length.

- The direction of a vector describes which way the vector is pointing in space. "

The standard way for visually representing a vector is simply with an arrow, because the arrow incorporates a magnitude (it's length) and direction (the direction the arrowhead faces).

Why a vector incorporates a magnitude and a direction can't really be answered exactly, because a vector is a mathematical tool and, in the most strict sense, has no parallel in the real world.

Though in the real world hyperbolic geometry doesn't really exist, it is useful nonetheless in terms of mathematics, as it allows mathematicians to arrive at results which otherwise might require a genius to discover. Vectors, like hyperbolic geometry, are a tool we use to take "shortcuts" to conclusions which otherwise would have taken a great deal of work and ingenious mathematical intuition to arrive at. They allow the non-prodigious bunch of us to actually make progress in advanced mathematics.

A matrix is a natural extension of the vector concept, whereby the vector is made analogous to a multi-dimensional array in programming.

EDIT: Like skittleo said, there exists a second geometric interpretation of vectors, whereby a vector loses the direction component and becomes nothing more than a point. The reason for people interpreting them this way, is because, as I said in my first sentence, a vector purely mathematically is just a list of numbers, therefore a point is a vector, as a point in n-dimensional space is a list of n numbers.

[Edited by - nilkn on July 19, 2005 10:20:04 PM]
A unit circle may help you grasp the concept



A vector is just a line segment, if you put it's starting point on the origin, you can then get its angle and magnitude. For instance, from the picture, a vector with 60degrees has the coordinate (1/2, sqrt(3)/2). hope that helps.
Imagine two dots in the space.Lets nam eone of them origin.Now if you use a pensil amd draw a line from "origin" to "not origin" the pensil is moving in a particular direction.This in fact is the direction of the vector.The speed of a train travelling from a town A to a town B also is a vector and it's direction is from A to B.
As vectors typically are defined only by the coordinates of one of there vertices I'll have to add some mathematics to this explanation:a vector is the name of the set of all segments having a given lenght and a given direction in practise however 'vector' is also used to name a single representative of this set.So each vector has a representative with it's origin coinciding with the origin of the coordinate system(you may draw a representative of the set 'vector' from any given point).When saying the vector(1,3),we actually mean it's representative with origin(0,0).As all vectors have the same direction,the direction of (1,3) is the direction of this single representative.Hope this helps.Even I almost grasped what I am talking about... :-)
Some of you have said that for mathematicians vectors are lists of numbers. Let me correct that: vectors are things that you can add and scale. You add two vectors together and you get another vector. You scale a vector by multiplying it by a number. You also need these operations to satisfy some simple properties.

We can take a vector space minus the 0 vector and define an equivalence relation as follows: v is related to w iff there is an scalar c such that v=c*w. The equivalence classes of this relation are called directions. So the formal answer to your question is that a vector describes a direction as a representative of the class.

The directions have a very interesting structure called projective space.

This topic is closed to new replies.

Advertisement