This chapter covers
- Implementing a Python abstract base class representing general vectors
- Defining vector spaces and listing their useful properties
- Interpreting functions, matrices, images, and sound waves as vectors
- Finding useful subspaces of vector spaces, containing data of interest
Even if you’re not interested in animating teapots, the machinery of vectors, linear transformations, and matrices can be useful. In fact, these concepts are so useful there’s an entire branch of math devoted to them: linear algebra. Linear algebra generalizes everything we know about 2D and 3D geometry to study different kinds of data having any number of dimensions.
As a programmer, you’ve already got experience with generalization. When writing a piece of software, it’s common to find yourself writing similar code over and over. At some point you catch yourself doing this, and you consolidate the code into one class or function capable of handling all of the cases you’ve seen. This saves you typing and often improves code organization. Mathematicians follow the same process: after encountering similar patterns over and over, they can better state exactly what their seeing and refine their definitions.