concept width in category python

appears as: width, width, widths, widths
Math for Programmers: 3D graphics, machine learning, and simulations with Python

This is an excerpt from Manning's book Math for Programmers: 3D graphics, machine learning, and simulations with Python.

You probably already have some intuition for what it means to be two-dimensional or three-dimensional. A two-dimensional (2D) object is flat like an image on a piece of paper or a computer screen. It has only the dimensions of height and width. A three-dimensional (3D) object in our physical world, however, has not only height and width but also depth.

In the 2D plane, we worked with three interchangeable mental models of a vector: coordinate pairs, arrows of fixed length and direction, and points positioned relative to the origin. Because the pages of this book have a finite size, we limited our view to a small portion of the plane—a rectangle of fixed height and width like the one shown in figure 3.3.

Figure 3.3: The height and width of a small segment of the 2D plane

We can interpret a 3D vector in similar ways. Instead of viewing a rectangular portion of the plane, we start with a finite box of 3D space. Such a 3D box, pictured in figure 3.4, has a finite height, width, and depth. In 3D, we keep the notions of x and y directions, and we add a z direction with which to measure the depth.

Figure 3.4: A small finite box of 3D space has a width (x), a height (y), and a depth (z).
width, height = 400, 400 def to_pixels(x,y):     return (width/2 + width * x / 20, height/2 - height * y / 20)