Section 5.1 Operations with Vectors
A vector in \(R^n\) is an ordered collection of \(n\) numbers, represented as \((v_1, v_2, ..., v_n)\text{,}\) where each \(v_i\) is a number in \(R\text{.}\) In the two-dimensional space \(R^2\text{,}\) for example, vectors are represented a pair \((x, y)\text{,}\) and in three-dimensional space \(R^3\text{,}\) vectors are represented by triples \((x, y, z)\text{.}\)
In this section, we will introduce how to perform the arithmetic operations on vectors in Sage.
Vectors can be added and subtracted using the
+
and -
operators. The result of adding or subtracting two vectors is a new vector with the same number of components. A vector components can be scaled by a factor using scalar multiplication and the
*
operator. Here is an example of scalar multiplication of a vector by 2.