didn't you learn that in school? hm
well, the anglesto* functions return a vector calculated out of an set of angles (3 angles in degrees to rotate around each axis in the Cartesian coordinate system [3d space] i guess ;) ).
each object (e.g. player entity) has its own coordinate space. you can imagine the forward, right and up vector as another 3d coordinate system. the forward vector is the direction the object faces to relative to the world coordinate system etc.
vectortoangles turns a vector into a set of angles, so the reverse action of anglesto[vector].
why not using angles only? 'cause vectors have a direction and a length, so they can represent "more information" (a distance) than angle sets.
vectordot: the dot product of two vectors is the resulting value of a two-vector-multiplication.
/ 1 \ / 4 \
| -3 | * | 2 | = 1 * 4 + (-3) * 2 + 2 * 0 = 4 + (-6) + 0 = -2
\ 2 / \ 0 /
-2 is the dot product
(vector1 component x1 multiplicated by vector2 component x1 plus vector1 component x2 multiplicated by vector2 component x2 plus vector1 component x3 multiplicated by vector2 component x3)
to calculate the actual length (magnitude) of a vector you use good old Pythagoras:
square root of ( distance x1 squared + distance x2 squared + distance x3 squared )
distance = a (non-local / direction) vector, most likely the resulting vector of a two-local-vector-subtraction (which is basically a two-point-subtration)
note: the length is always positive due to the squaring ( number multiplicated by itself, can only be positive * positive = positive and negative * negative = positive)
a normalized vector is a vector which has the length of 1. A normalized vector can have the same direction like a non-nomalized vector, the difference is really just the length in this case.
to normalize a vector, divide each vector component (x1 to x3) by the vector's dot product:
/ x1 \
normalized vector = dot product : | x2 |
\ x3 /
/ x1 \
normalized vector = (1/dot product) * | x2 |
\ x3 /
!!! not to be confused with "normal" vectors:
a cross product (vector product) function is missing, but not really needed anyway - can be done via scripted function.
btw. there is another script parser function (cod4/5 only?):