title: Vectors and Points
author: tiglari

'Vector' means 'carrier' in Latin.  Hence rats as plague
vectors.  In mathematics, the most basic meaning is
a relationship between two points, namely, the
displacement that would carry one into the other, and
also a sequence of numbers representing that displacement,
such as 2 units forward, 3 to the left and 1 up, giving
the vector &lt;2,3,1&gt;, or quarkx.vect(2,4,1) in QuArK
Python programming.  We'll call the relationships between
points 'geometric' vectors, the sequences of numbers
'sequence' vectors (this isn't standard terminology, but I
find it useful).
Since only the sequence vectors can be manipulated
by computer programs, in a sense they are the only ones
that are relevant, but on the other hand what the programs
are doing is helping people to build their spatial
imaginings, so I personally think it's helpful to have
a solid grasp of the relationship between the sequence
vectors and the geometrical ideas they represent.

Geometrical vectors can be 'added'
in the sense of performing one displacement after another,
and also multiplied by numbers, in the sense of performing
the displacement a (possibly fractional or irrational)
number of times.  Similarly, the sequence
vectors can be added by adding the numbers in the
corresponding positions, or multiplying all the numbers
by the same number:
<code>
&lt;x, y, z&gt; + &lt;u, v, w&gt; = &lt;x+u, y+v, z+w&gt;
a*&lt;x, y, z&gt; = &lt;a*x, a*y, a*z&gt;
</code>
In jargon, for sequence vectors, addition of vectors and
multiplication of a
vector by a 'scalar' (an ordinary number, in context where
vectors are the focus of attention) are defined
'componentwise'.

The components are of course the individual numbers, and if
v is a QuArK vector, we can get its first, second and third
components as v.x, v.y and v.z respectively (there are also
5-component vectors for use with bezier patches, with .s and
.t in addition, but we won't worry about those here).

If we're using the number sequences to represent
displacements, we can see that the algebraic definition
agrees with our intuitive conceptions of how addition of
displacements and the multiplication of a displacement
by a number should work, and if you crank through the
algebra you should be able to see that all of the standard
sequence laws such as commutative and associative
work, for those combinations to which they are applicable.
For example:
<code>
(a+b)*(v+w) = a*b + a*w + b*v + b*w
a*(b*v) = (a*b)*v = (b*a)*v = b*(a*v)
</code>
Vector algebra or calculus textbooks will give complete
lists, but basically it's just Junior Hi-level algebra.

And in QuArK python, + works for vectors, and * will
combine a vector and a float, the only difference from
standard math notation being that you can also put the
float second, or use the division symbol in the usual
way:
<code>
(1/a)*v == v*(1/a) == v/a
</code>
(if v is a vector and a is a float).

It is also usual for vectors to be used to represent points,
but there's a issue here: it makes no sense to add
points to each other, or multiply them by numbers.  What's
going on is that to represent a point by a vector, we first
need to pick a special point called the 'origin'.  Then we can
use vectors to represent other points as relationships to (i.e.
displacements from) the origin.

So at this point we have three somewhat different kinds of things
floating around:
<UL>
<LI> Geometric vectors: relationships between points in space, independent
of any representation, by number-sequences or otherwise, with the conceptions
of addition and multiplication.

<LI> 'Sequence vectors':  sequences of numbers (in this case sequences
of length 3, tho there are other possibilities), with the componentwise
addition and scalar multiplication.

<LI> Geometric points in space: relationships between these give geometric
vectors, which can be represented by sequence vectors given some further
arrangements, which we'll be looking ito shortly.
</UL>

To get a geometric vector from a point, we need an origin
point; how do we get an sequence vector from a geometric one?
What we need is three vectors of length one, all perpendicular
to each other, taken in a definite order.  This is called
an 'orthormal basis', 'ortho-' meaning perpendicular, 'normal'
meaning of length one, and 'basis' being a math term whose
true meaning we won't reveal quite yet.  The vectors in the
basis are by convention associated with the x, y and z axes,
and often designated as <b>i</b>, <b>j</b> and <b>k</b> in
3D math books.  Given an orthonormal
basis, we can represent a geometric vector by the sequence
of numbers indicating how far you go in the direction of each
vector of the basis, taken in order.

It's an essential point that the representation of geometrical
vectors by sequence vectors has an arbitrary aspect: given a
different choice of basis, there will be different numbers.
Suppose for example we have an orthonormal basis
<b>i</b>, <b>j</b> and <b>k</b>, and replace <b>j</b> with
-<b>j</b>.  What will happen to the sequence vector
representing a given geometric one?

To represent a geometric vector with an sequence vector(in
the standard way; there are some other possibilities), we
need an orthonormal basis, but we don't need an origin.
But to represent a point as an sequence vector, both an
origin and an orthonormal basis is required: the origin lets
us represent a point with a (geometric) vector, and the
basis lets us represent the geometric vector with an sequence
one.  We find out more about this in the next section.
an origin with an orthonormal basis is a 'coordinate system'.
