Section 5.2 Cross and Dot Products of Vectors
Vectors do also support non-arithmetic operations, and operations that apply to the vector itself and its components.
For instance, another form of vector multiplication is the dot product, where two vectors \(v\) and \(w\) are multiplied with each other to produce a scalar value. The dot product of two vectors \(v\) and \(w\) is defined as the sum of the products of their corresponding components. The dot product is commutative and yields a scalar value \(v \cdot w = w \cdot v = \sum_{i=1}^n v_i w_i\text{.}\)
Note that the dot product in Sage is implemented in more than one way. All the following statements are equivalent and produce the same result.
The cross product of two vectors \(v\) and \(w\) is defined only in 3D space and is calculated using the determinant of a matrix formed by the unit vectors \(i, j, k\) and the components of the vectors \(v\) and \(w\text{.}\) In Sage, the cross product is calculated using the
cross_product
method.