concept vector addition in category python

This is an excerpt from Manning's book Math for Programmers: 3D graphics, machine learning, and simulations with Python MEAP V11.
Like numbers, vectors have their own kind of arithmetic; we can combine vectors with operations to make new vectors. The difference with vectors is that we can visualize the results. Operations from vector arithmetic all accomplish useful geometric transformations, not just algebraic ones. We’ll start with the most basic operation: vector addition.
Vector addition is simple to calculate: given two input vectors, you add their x-coordinates to get the resulting x-coordinate and then you add their y-coordinates to get the resulting y-coordinate. Creating a new vector with these summed coordinates gives you the vector sum of the original vectors. For instance, (4, 3) + (-1, 1) = (3, 4) because 4 + (-1) = 3 and 3 + 1 = 4. That’s a one-liner to implement in Python:
Figure 3.13: Two visual examples of vector addition in 3D
![]()