Vector or screen displacement

Pages: 12
to represent a vector on a screen wouldn't you need both the x,y coordinates of both points?

You answer your own question at the beginning of your post:
so a vector ... has both a length( size ) and direction

A vector has just a length and direction - no origin (starting point). If you want to represent length and direction with an origin, use two vectors: one that specifies the origin and another that specifies the vector itself.
A Position Vector, for a start, has a starting point, and by definition, that starting point is at the origin! ( Doubtless some outliers might call the origin Position Vector (0,0) )

Plenty of other cases occur in various types of static and dynamic force analysis where vectors have a starting point, commonly called the point of application, never referred to as the (position) vector of application, but nevertheless vitally important.
ah ok I think my dumb brain is starting to piece it together,

the reason Stephen uses just two points is to represent a 2d vector is because the point of origin is implied ( this is probably 0,0 but could be any point, certainly 0,0 with most game engine frameworks )

when adding two vectors lets say our first vector's (A) head is at (x = 50,y = 50) from the origin and our second vector's (B) head is at (x = 25, y = 25) we would add B to A and this would get our new displacement vector??

I think I'm on the right track?

A vector has just a length and direction - no origin (starting point). If you want to represent length and direction with an origin, use two vectors: one that specifies the origin and another that specifies the vector itself.


how can a vector have a length without two points??
Last edited on
how can a vector have a length without two points??


A vector could be "30 ft. NW". There are no points determining the length.

If somebody told you to run 30 ft. NW, you could do that. It doesn't matter where you currently are. I could do it from my location, and I would end up somewhere else than you end up. But we would both move 30 feet in the NW direction.

The vector "30 ft. NW" can be represented by the point (-21.21, 21.21) (approx.) because a segment from the origin to (-21.21, 21.21) is 30, and the direction is NW.

There are not 2 points determining the length. Instead, a single point represent both length and direction. It's shorthand. It is NOT a segment.

A vector could represent velocity. A car moving 50 mph due south could have a vector represented by (0, -50). What points are you going to use to represent that vector?
Last edited on
I will also add that the "length" of a vector is simply the result of applying a function to the vector. For example, most commonly for Cartesian vectors:
length((x, y)) = sqrt(x^2 + y^2)
and for polar vectors:
length((r, θ)) = r

Calling it "length" is a colloquialism. The more appropriate term is "norm", which is intended as a generalization of the idea of absolute value into multiple dimensions:
|x| = sqrt(x^2) = sqrt(x^2 + 0^2) = norm((x, 0))


PS: Note that the above is the Euclidean norm. There are other ways of defining norm, such as the Manhattan norm:
norm((x, y)) = |x| + |y|
ok so the x and y value represent the destination? there isn't necessarily a starting point, but when discussing vectors in association to moving objects on a computer screen that x and y value is normally the displacement or point where it moved from from the origin right?

A vector could represent velocity. A car moving 50 mph due south could have a vector represented by (0, -50). What points are you going to use to represent that vector?


would be virtually impossible to represent.

length((x, y)) = sqrt(x^2 + y^2)


That's another related question I was meaning to ask why is the length or magnitude of a vector = sqrt(x^2 + y^2)
Last edited on
when discussing vectors in association to moving objects on a computer screen that x and y value is normally the displacement or point where it moved from from the origin right?
In such a context, the vector is how far the object will move in a unit of time, relative to its present position.

why is the length or magnitude of a vector = sqrt(x^2 + y^2)
As previously stated, the norm can be defined to be whatever you want. The Euclidean norm just so happens to coincide with the intuitive notion of distance on a flat plane. If, on a flat plane, you move x meters to the left and y meters forward, your total displacement from the original position will have been sqrt(x^2 + y^2) meters. This is a consequence of the Pythagorean theorem, as those two motions are the catheti of a right triangle, while the straight line between the original position and the final position is the hypotenuse of that same triangle.

Note that, again, Euclidean norm is only valid on a flat plane or on a "flat" volume (topologically speaking, a space without curvature where geodesics are straight lines), not on, for example, the surface of a sphere. If you move 37,700 km West and 100 km South, your total displacement will be of only about 100 km (assuming you were on the Equator when you started).
Last edited on
In such a context, the vector is how far the object will move in a unit of time, relative to its present position.


ah ok so a vector is kind of just like a force if it's moving fast in the right direction( magnitude ) it's x value will be quite large likewise if it's moving slow it will have a smaller x value. The y value does not change or it is 0 as it's only moving laterally to the right.

now lets say we have an object that has enough force to move another object, let's take a rather arbitrary ( and pretty stupid ) example, we have a cannon that shoots cannonballs at a static object, when that cannonball hits the static object it will push it back a certain distance, the distance this static object moves back depends on the velocity or in this case the cannonballs x value , so let's say it's moving at a velocity or increment of 3 on the x axis, we would move the static object back by 3 places ie we add the vector ( of the cannonball ) to the x,y points of the static object.

horrible example but I think I'm on the right path?? of course in a real world or real game example there would be many more factors to how far the static object reacts but that is a relatively simplified example.

Last edited on
In a perfect elastic collision (total energy preserved), if the cannonball directly hit an immobile cannonball of the same mass, the two balls would swap motion vectors. If the balls had different masses they would swap momentum vectors.

I don't think these collision examples are very helpful. Modeling collisions is fairly complex, and not easy to understand if you don't already have a solid grasp of vectors.
true but in my more contrived example ( ignoring a lot of physics laws ) I'm on the right path? a vector is a force of an object right? and it's magnitude is how fast it is going in a certain direction? another example two objects hitting each other ( both objects going different directions ) let's say object A is going vertically down and object B is travelling laterally right, both objects collide the new direction of both objects will be their vectors adding together right ?
Last edited on
Vectors are a way to represent quantities with direction, such as velocity, force, and momentum. And yes, a vector with higher norm indicates that the quantity in question has higher magnitude.
The whole point of p535 is operator overloading and not how the x and y components of a vector are obtained.

The magnitude and direction of vector can be determined from the start and end points but that depends on the context and what the vector is describing.

A car travelling along a road has a position vector relative to it’s home garage (say). There is a starting point and end point.

The car also has a velocity vector which can be read from the speedometer, direction from a compass. Or, with the car, the velocity can be determined from it’s position vector and a stopwatch. Take you pick. In both cases if you only record the magnitude and direction the start and finish points are lost forever. You have a free vector.

And for acceleration/braking the same principle and alternatives apply. Acceleration is derived from the velocity vector and timing.

The position vector, velocity vector and acceleration vector are 3 separate vectors all describing different magnitudes and directions.
Topic archived. No new replies allowed.
Pages: 12