






































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







































The distance between two points (Ax,Ay,Az) and (Bx,By,Bz) can be found by again using the pythagorus theorem
Like it's 2D counterpart, a vector can be thought of in two ways: either a point at (x,y,z) or a line going from the origin (0,0,0) to the point (x,y,z).
To calculate the length of a vector we simply calculate the distance between the origin and the point at (x,y, z) :
Often in 3D computer graphics you need to convert a vector to a unit vector, i.e. a vector that points in the same direction but has a length of 1.
This is done by simply dividing each component by the length:
Note that if the vector is already a unit vector then the length will be 1, and the new values will be the same as the old ones.
Adding vector to point
point.x = point.x + vector.x; point.y = point.y + vector.y; point.z = point.z + vector.z;
vector + vector => vector
point + vector => point
point – vector =
point + (-vector) => point
Multiplying a vector by a scalar ( a number with no units) :
Vector.x = Vector.x * Scalar
Vector.y = Vector.y * Scalar
Vector.z = Vector.z * Scalar
A vector of length 4
If multiplied by -2.5 instead,
Yields a vector of length 10;
but in the direction opposite to original
Vectors can be multiplied in two ways: