4D Spin

Mathematical Graphics in 4 Dimensions

For iPhone and iPod touch

 

Free on the App Store.

 

The App

 

4D Graphics-  Discussion

 

FAQ - What is the 4th Dimension?

Rotations

4D-Cube

Functions of a Complex Variable

 

Other Software

 

For Windows:

“Software for people who love mathematics.”

 f(z) and Fields&Operators

 

For iPhone and iPod touch:

Coming Soon.

 

 

 

The App for iPhone or iPod touch

App.tiff

A sampler of some basic mathematical objects rotating in 4 dimensions!

Computer Graphics in 4 dimensions need not be mysterious.

As the publisher of software that has helped a generation of students visualize advanced mathematics, we are excited to present this little collection of objects that you can rotate in 4 dimensions.

A brief discussion of the theory of 4 D graphics is included with the app. This web site provides more details.

But even if you are not interested in the mathematics below, we think you will be fascinated as these shapes seem to fold into themselves as they rotate. 

The Static screen shots you see here cannot give a good representation of what you will actually see on your iPhone or iPod touch.

 Download the free app here.

 

 

 

A swipe of the finger horizontally or vertically on the screen will start them spinning. But that is not enough control in 4 dimensions. Buttons on the bottom of the window allow you to experiment with which dimension is “perpendicular” to the screen.

 

Most Frequently Asked Question: 

 

“What is the 4th Dimension?”

 

Answer:

 

This is not really relevant. Mathematical graphs and drawings can illuminate concepts other than spacial geometry.

For example, to illustrate the temperature distribution of a flat (2-dimensional ) steel plate, you might draw a bar graph with the height of each bar representing the temperature at that point.  The result lives in 3 dimensions.

Now suppose you wanted to associate 2 numbers with each point. You would have 4 dimensions of data (two for the position of the point and two values for each point). 

There are many ways such data can be represented graphically. For example, a vector (arrow) can be drawn at each point. The direction of the arrow determined by the 2 values. (See example here).  In some cases, however, representing the data as a graph that can be rotated in 4 dimensions can be very useful. This is especially true when the data arises from certain mathematical constructs.

Our app shows examples where some insight into the underlying mathematics can be gained from rotating the object under study.

These notes focus on the details of rotation, the 4D Cube, and graphs of functions of a Complex Variable.

 

 

Points in 3 dimensions can be represented by 3 numbers (x,y,z). To make 3-dimensional objects move on a computer screen, software applies various computations to the points that define the object, and then draws them to the 2-dimensional screen by using only the x and y coordinates. (This is called "projection.")

For example, a simple rotation in the y-z plane by an angle a may be computed by

newX = x

newY = y * cos(a) - z * sin(a)

newZ = y * sin(a) + z * cos(a)

Computers (and now telephones) are good at that sort of thing.

Raising this to 4 dimensions is easy. Let's call the 4 coordinates (x,y,u,v). Leaving interpretation aside, a "shape" is made of a collection of such points. The same general type of mathematical transformation can be applied to these coordinates. For example, a rotation in the y-v plane would be:

newX = x

newY= y * cos(a) - v * sin(a)

newU= u

newV= y * sin(a) + v * cos(a)

When projected onto the screen only the computed (newX, newY) coordinates are used, but all coordinates are computed because they influence subsequent rotations.

Rotation is only one kind of transformation, and the computation may be more complicated than this. But all rotations can be built by combining simple computations of this type.

Transformations used in computer graphics are an application of Linear Algebra, where, by the way, infinite dimensional vector spaces are common.

 

 

 A square in 2 dimensions can be defined by the four corners:

(-1,-1), (-1,1), (1,1), and (1,-1).

In 3 dimensions, a cube has corners:

(-1,-1, -1), (-1, 1,-1), ( 1, 1,-1), ( 1,-1,-1),

(-1,-1,  1), (-1, 1 ,1), ( 1, 1, 1), and ( 1,-1, 1).



Notice the pattern we used to build the cube from the square - we took the four corners of the square and appended "-1" for the third coordinate, and then took the four corners again and appended "1". This gives us all possible combinations of -1 and 1.

How many combinations of 1 and -1 are there if we build 4 dimensional coordinates? We can repeat the procedure we used above and take the 8 vertices of the cube and first append -1 and then append 1.

(-1,-1, -1, -1), (-1, 1,-1, -1), … ( 1,-1, 1, -1)

. . .

(-1,-1, -1,  1), (-1, 1,-1,  1), … ( 1,-1, 1,  1)

Having a list of coordinates is only the first step in drawing a shape. We must decide which vertices to connect by line segments.

An interesting question occurs in trying to find a simple "path" through the coordinates. Can you list the coordinates so that each point differs from the previous one in only one spot? This corresponds to tracing the edges in a single path without duplicating an edge. For a 2-dimensional square this is easy. It is impossible for the 3-dimensional cube. How about the 4-D cube? (We leave it the topologists and graph theorists to explain this. Hint - "Euler".)

 

Cubes and Dimensions in Algebra and Calculus

So far we have looked at the 4D cube from a combinatoric point of view, where we looked at patterns of combinations of 1s and -1s.  xplus1squared.gifThinking in terms of geometry and dimension can give additional perspective to some basic algebraic identities.

The identity (x+1)2 = x2 + 2x + 1 can be interpreted geometrically as how to do grow a square of side x to a square of size x+1.

Similarly, the identity (x+1)3 = X3 + 3x2 + 3x + 1 tells us that to grow a cube of size x to a cube of side x+1 we add 3 squares, 3 rows, and a singleton.

xcubedplus1.bmp

Of course, we don’t have to use geometric intuition when thinking about the identity

(x+1)4 = x4 + 4x3 + 6x2 + 4x + 1.

 It is, after all, just a statement about arithmetic. But we can see that this case is similar to the earlier examples in that we build up volume by attaching lower dimensional pieces. If you’ve watched the 4D-Cube rotating using our iPhone App, then you might have had a sense of 4 standard cubes forming the boundary layer of the 4D cube.

The relationship of boundary layers is even more clear in elementary calculus.

One of the first computations students of calculus learn is the differentiation of polynomials. For example:

 d/dx x3 = 3x2, or

 d/dx x4 = 4x3.

That computation is based on applying limits to the algebraic identities mentioned above.cubewithlayers.bmp

Imagine a cube that is slowly growing (like a balloon being inflated). If the side of the cube is x, then the volume is x3. The derivative is a measure of much “stuff” is added to the volume as it grows. We see that, in some sense, we add 3 sheets of size x2 to the cube as it grows slightly (the derivative = 3x2). It is easy to visualize this geometrically.

For the polynomial x4, the lower dimensional “sheets” are 3D cubes. Again, this is just a statement about arithmetic. We just use geometry and dimension to guide our thinking.

 

 

 

The mathematics of Complex Variables is the fundamental language of most engineering disciplines, yet graphs of functions of complex variables are inherently 4-dimensional, and so are not often visualized. Rotation in 4-dimensions can help in understanding their properties.

Graphs

graph and projection.gifThe "graph" of a function is the set of pairs (z, f(z)) where z represents the input and f(z) represents the output. We are all familiar with the case where z and f(z) are simple “real” numbers. In this case the input and output are each one dimensional, and so the graph is drawn in 2 dimensions. The diagram at the left illustrates the relationship between the graph, the domain, and the range. (We use the terms “domain” and “range” a bit loosely to indicate input and output respectively.) Notice that in this example some points in the range are covered multiple times by the projection.

In the world of complex variables each “number” is composed of two parts (z=x+iy, where x and y are real numbers) and so is represented graphically as two dimensional. With two dimensional input and two dimensional output, the graph lives in four dimensions.

 

f(z) = ez

 

We will focus on the example:  f(z) = ez. This is defined as  ex+iy = ex cos(y) + i ex sin(y). The graph is the set of four dimensional points, (x, y, ex cos(y), ex sin(y) ). graphwithquestionmark.bmp

Even without the graph, it is useful to look at sets in the domain and see their images in the range.

Below we show some snapshots of the rotating graph. Consider some consequences of the definition that we should look for in the graph:

·         For a fixed value of x (corresponding to a vertical line in the domain), the image is a circle of radius ex.

·         The annulus is covered multiple times, once for each vertical extent of 2p  in the domain. Compare this to the illustration above of real-valued functions where points in the range are covered multiple times by the projection.

·         The radius grows exponentially as x increases and shrinks toward 0 as x approaches negative infinity. (It never reaches zero because there is no log(0). )

·         For a fixed value of y (corresponding to a horizontal line in the domain), the image is line at angle y.

·         For fixed x, the real and imaginary parts of the image are each sinusoidal.

See the snapshots of the graph below.

 

f-inverse

What is the relationship between the graph of a function and the graph of its inverse, f-1? (The inverse of ez is log(z).) If we restrict our attention to regions where the function is 1 to 1 (i.e. we don’t have points in the range covered multiple times) then the graphs of f and f-1 are essentially the same!

 

A beautiful and powerful concept in Complex Variables is the notion of the Riemann surface of a function. Briefly, this is an extension of idea of domain that allows the function to be considered 1 to 1.

 

Depending on how the set in the domain is chosen, the graph may reveal the Riemann surface of f-1 as it is rotated. If you are familiar with the complex logarithm, you should be able to recognize its Riemann surface in the snapshots below. Also, be sure to use our software to look at the graph of f(z) = z2 because the Riemann surface of the square root function is quite interesting.

 

Gallery of snapshots of rotations of graph of ez

Gallery4D.bmp

All images produced by f(z) software.

 

 

When you think you are getting comfortable understanding the shape of this graph, remember that the only action taking place is rotation!