6 Generalizing to higher dimensions

 

This chapter covers

  • Implementing a Python abstract base class for 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 still 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 data in any number of dimensions.

As a programmer, you’re probably skilled at generalizing ideas. When writing complex 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 see. This saves you typing and often improves code organization and maintainability. Mathematicians follow the same process: after encountering similar patterns over and over, they can better state exactly what they see and refine their definitions.

6.1 Generalizing our definition of vectors

 
 

6.1.1 Creating a class for 2D coordinate vectors

 
 

6.1.2 Improving the Vec2 class

 

6.1.3 Repeating the process with 3D vectors

 
 
 

6.1.4 Building a vector base class

 
 

6.1.5 Defining vector spaces

 
 

6.1.6 Unit testing vector space classes

 
 

6.1.7 Exercises

 
 
 

6.2 Exploring different vector spaces

 
 

6.2.1 Enumerating all coordinate vector spaces

 
 
 

6.2.2 Identifying vector spaces in the wild

 
 

6.2.3 Treating functions as vectors

 

6.2.4 Treating matrices as vectors

 
 
 

6.2.5 Manipulating images with vector operations

 

6.2.6 Exercises

 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest