Sep 1, 2019

Publicly available lecture notes from universities mathematics classes

Euler Disc and its mathematics

As described in wikipedia:

Here are the videos where the Euler discs phenomenon is highlighted and explained:  (interesting study of the Euler Disc motion from an engineering point of view).   (here the mathematics is worked out in details - and quite easy to understand with undergraduate Physics as background)

Aug 12, 2019

Exploring about Mandelbrot Set

And trying out the GeoGebra software:  (these files are from Ben)

To see the sequence of square operation and its path:

Jul 10, 2019

Update: Mathematics Olympiad Problems

Updating this page:

(some links are invalid) and here below is just a very small subsets:

Jun 30, 2019

Ring of circles

I found a good mathematical resource for OpenGL from Cambridge University:

This is a simplified version of earlier program, hopefully to reduce unnecessary clutter:

And instead of a circle, which is drawn as a polygon of 30 sides, we can fixed it to TWO-gon:

The rod-shaped structure formed a flat surface - with top and bottom surface. 

How to make it into a Mobius surface?   So what if now the generator of the 2gon is shifted by a angle offset as it goes round the circle - and the total angular offset should total 180 degrees?

This is the result:

And the source code is here:

Instead of a 2-gon, why not change it to a 3-gon (triangle) and you will get this:

Instead of triangle (ngon=3) or circle earlier (ngon=30), what if we want to form helix?   Then instead of drawing circle by itself, we need to rotate the circle while drawing the circle, forming this:

And the source code is here:

And what if you make the circles move in a sinusoidal pattern around at the periodic frequency of 2?

The above is the result:

And in case you think the single colored rings are too boring:

Jun 28, 2019

Creating a torus (animated and variations)

Looking at the Pentagon torus:

And its source code:

And changing the rings to 30:

And if you use triangle surface to create the Pentagonal torus in 3D:

What are the difference in programming?   In the previous two, the torus is created by a prebuilt function called (look into the "display()" function for how the object is generated) glutWireTorus().
        global xrot, yrot, zrot
        global ndisc
                0.0, 0.0, 10.0,
                0.0, 0.0, 0.0,
                0.0, 1.0, 0.0)
        glRotatef(xrot, 1.0, 0.0, 0.0)
        glRotatef(yrot, 0.0, 1.0, 0.0)
        glRotatef(zrot, 0.0, 0.0, 1.0)
        glColor3f(0.5, 0.0, 1.0)
But in the case of triangulated surface generated torus it is built from scratch using "triangle", and thus can be controlled via use of cosine() and sine() to generate the triangles for the surface of the torus.   The technique is to generate a list of coordinates of the vertices of the surface, and the normal vector centering on that coordinate.
        vertices = []
        normals = []
        u_step = 2 * pi / (slices)
        v_step = 2 * pi / (inner_slices)
        u = 0.
        for i in range(slices+1):
            cos_u = cos(1*u)
            sin_u = sin(1*u)
            v = 0.
            for j in range(inner_slices):
                cos_v = cos(1*v)
                sin_v = sin(1*v)
                d = (radius + inner_radius * cos_v)
                x = d * (cos_u +2)* cos_u
                y = d * (cos_u +2)* sin_u
                z = inner_radius * sin_v
                nx = cos_u * cos_v
                ny = sin_u * cos_v
                nz = sin_v
                vertices.extend([x, y, z])
                normals.extend([nx, ny, nz])
                v += v_step
            u += u_step
        # Create a list of triangle indices.
        indices = []
        for i in range(slices):
            for j in range(inner_slices):
                p = i * inner_slices + j
                indices.extend([p, p + inner_slices, p + inner_slices + 1])
                indices.extend([p, p + inner_slices + 1, p + 1])
        self.vertex_list = batch.add_indexed(len(vertices)//3,
                                             ('v3f/static', vertices),
                                             ('n3f/static', normals))