math visualization

  • Me: I'm really bad at science, math-
  • Friend: well a lot of people aren't great at science or math-
  • Me: -spatial awareness, visualizing in 3-D, managing my time, organizing or figuring out other people's organization, understanding people, observing small or even large details, remembering small or even large details, retaining information for longer than a semester-
  • Friend:
  • Friend: so what are you good at?
  • Me:
  • Me:
  • Me: making shit up on the fly and sounding like I'm good at everything.

Prime Numbers Visualization.

A prime number (or a prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself. Primes are special numbers, then what makes primality so special? Don Zagier, an eminent specialist, said: Upon looking at these numbers, one has the feeling of being in the presence of one of the inexplicable secrets of Creation.
This image is created using circles with consecutive prime number diameters stacked on top of each other and repeated from a common origin. For each natural number n, we draw a periodic curve starting from the origin, intersecting the x-axis at n and its multiples. The prime numbers are those that have been intersected by only two curves: the prime number itself and one. The currently highlighted number show sum of divisors σ(n), and its aliquot sum s(n) = σ(n) - n, which indicate whether the number is prime, deficient, perfect or abundant. 

okay, so one of the first thoughts i had during the trailer, right at the very end, was, ‘holy shit! drones aren’t supposed to be that big!’

like it wasn’t even a case of ‘wow, i didn’t expect them to be that big,’ i was convinced they were smaller fighting dirk. so i went and got the best panel i could find of dirk right next to a drone, i.e, the one where a drone is literally grabbing dirk in its hand.

i saw that and was like, hey, okay, i guess it’s still pretty big, but it doesn’t seem nearly as big as in the trailer… so i pulled up SAI and did the visual math.

holy fucking shit, guys.

Conceptualising Integration

Area of a circle in Cartesian co-ordinates

Cont’d from “Visualising integration of 3D Cartesian-based volumes”, see “Visualising integration of 2D Cartesian-based areas

This post is best viewed on my blog, click here to be taken to its permalink.

I’m sure we know how to go about integrating a circle whose centre point is placed on the origin – particularly in polar co-ordinates – but what about one displaced from the origin in Cartesian co-ordinates? Not such a simple problem.

We’ll start by visualising the scenario geometrically. Consider a circle of radius r displaced from the origin by a distance R. We’ll say for simplicity that R acts purely in the x-direction, meaning it has no vertical component. Hence, the scenario is pictured as below.

There are multiple ways we can approach this problem but we’ll go for simplicity whilst maintaining some challenge, of course. Let’s start by finding a function to represent the circle’s boundaries, so to obtain a contour (well, it’s not strictly a contour but I’m gonna call it that, sorry) with which to integrate over. It should be clear that, as it is, the circle cannot be represented as a function since it would require two y-values for one x-value. However, if we manipulate the scenario a bit it becomes a more viable option.

Now we have a semi-circle! As you can see, no two points intersect the same vertical line. Hence, a function y(x) can be found to represent the bounding contour line.

By trigonometry, we know how to express the radius of a circle as a product of its x and y components. In the most general sense, for a circle with its origin at the co-ordinate (a, b) this is,

r2 =(xa)2 + (yb)2

The proof for this is simply Pythagoras’ theorem so I will leave it out. Furthermore, in our case,

r2 = (xR)2 + y2

which is represented by the red line in the following diagram.

Hence, our function can be expressed as

y(x) = (r2 – (xR)2)½

Now we can use this to set the integration limits. The shape is bounded in the x-axis by Rr and R + r. Therefore our x limits are

Rr < x < R + r

In the y-direction, however, the shape is bounded by the red line shown above which is given by our function y(x). Hence, we can say that the limits in y are,

0 < y < y(x)

Since this notation is a little confusing, more explicitly our limits are,

0 < y < (r2 – (xR)2)½

Using these limits, we can express the area integral, ½ A, in one of two ways: Either as the integral of an infinitesimal area element dA = dxdy over the limits given above (discussed in detail in a previous post), or as the integral of the function y(x) between the limits of x. To be explicit about this, we’ll use the former since it is the most generally useful.

Hence the area of our semi-circle is,

½ A = ∯y(lim x)dA

which essentially tells us that half the area of our circle is given by the area bounded by the function y(x), where y(x) is bounded by the limits of x. This is unconventional notation (and mathematicians would be tearing their hair out at such misuse of notation) but it is satisfactory for our purposes. Substituting the Cartesian area element dxdy and applying the limits outlined by y(x) we get

A = 2 ∫R-rR+r0√(r² – (xR)²)dydx

Since this series is all about visualising and conceptualising the processes taking place during integration, what does this look integration look like?

This animation shows how each infinitesimal element plays a part in the integration process to find the area. First the dy element scans the y-axis to outline the function y(x), which the dx element is dragged along and bounded by.

We can now evaluate the integral directly. Note that we cannot separate the double integral since the limits of y are dependent on x.

A = 2 ∫R-rR+r[y]|0√(r² – (xR)²)dx

A = 2 ∫R-rR+r[(r2 – (xR)2)½ - 0] dx

A = 2 ∫R-rR+r(r2 – (xR)2)½dx

This is where the integral gets a little more complicated.

Using substitution, we can let

u(x) = xR ⇒ du = dx

and evaluate the limits for this substitution,

u(xR + r) = (R + r) – R = + r

u(xRr) = (Rr) – R = – r

which allows our integral to become

A = 2 ∫-r+r(r2u2)½du

A further substitution is required. With manipulation, we could use the trigonometric identity cos²(x) + sin²(x) = 1 to our advantage. Hence, we shall make the substitution,

u(x) = r sin [v(u)]

which implies,

du/dv = rd/dv[sin (v)] ⇒ du = r cos (v) dv

Again, we can evaluate the limits of v(u).

v(u) = sin-1(u(x)/r)

v(u → + r) = sin-1(r/r) = sin-1(1) = π/2

v(u → – r) = sin-1(– r/r) = sin-1(– 1) = – π/2

which makes the integral

A = 2 ∫-π/2 +π/2 (r2r2 sin2v)1/2r cos v dv

Looks way more complicated, right? Let’s make some simplifications. Start by taking out the constants,

A = 2 r-π/2 +π/2 (r2r2 sin2v)1/2 cos v dv

and factoring out common factor of r².

A = 2 r-π/2 +π/2 [r2 (1 –sin2v)]1/2 cos v dv

Now, remember that trig. identity I mentioned earlier? Let’s apply it here, wherein 1 –sin² v) = cos² v.

A = 2 r-π/2 +π/2 [r2 cos2v]1/2 cos v dv

Cancel out the square with the root and take out the resulting constant.

A = 2 r-π/2 +π/2 r cos v cos v dv

A = 2 r2-π/2 +π/2 cos2v dv

Nearly there! Here, we can use another trigonometric identity: The half-angle identity, which states that cos² v = 1/2 + (cos 2v)/2.

A = 2 r2-π/2 +π/2 [1/2 + (cos 2v)/2] dv

Take out the constant and separate out the integrals since ∫ [f(x) + g(x)] dx = ∫ f(x) dx + ∫ g(x) dx.

A = 2 (1/2) r2 { ∫-π/2 +π/2 (1) dv + ∫-π/2 +π/2 cos 2v dv }

Now, we can evaluate the first integral with ease.

A = r2 { [v]|-π/2 +π/2 + ∫-π/2 +π/2 cos 2v dv }

A = r2 { [π/2 – (– π/2)] + ∫-π/2 +π/2 cos 2v dv }

A = r2 { [π/2 + π/2)] + ∫-π/2 +π/2 cos 2v dv }

A = r2 { π + ∫-π/2 +π/2 cos 2v dv }

Unfortunately, the second integral isn’t so easy. We have to make yet another substitution.

w(v) = 2vdv = dw/2

and evaluate the limits.

w(v → + π/2) = 2(π/2) = + π

w(v → − π/2) = 2(− π/2) = − π

Hence, the integral is

A = r2 { π + ½ ∫ cos w dw }

which evaluates to

A = r2 { π + ½ [sin w]|}

A = r2 { π + ½ [sin (π) – sin (– π)]}

A = r2 { π + ½ [0 – 0]}

Finally, we find that the area of our circle is

A = π r2

Revolutionary stuff, eh? (pardon the pun)

Although the result is something we already knew, the proof is still essential and the process used to find it is valuable knowledge since we can now apply this to a much less general case. In addition, it is useful to know how to integrate more complicated objects than cubes and rectangles in Cartesian co-ordinates.

I will use and expand upon this result to integrate a torus (i.e. a ring-doughnut shape), following the challenge informally set by tumblr user voidpuzzle.

i love when i reach ‘that point’ of wokring on something when i can’t focus anymore and my muscles/motor ksills refuse to cooperate with me, but i’m not dnee yet? that’s a fantiast c feeling i m loveing it


1DDCB (New Age Dark Age)

Creative coding project by @ravenkwok uses the Processing programming language to develop audio visuals with 3D Voronoi technique:

1DDCB is a hybrid, basically blending rules and visual forms used in the generative systems for Skyline ( & Stickup ( As always, this system is programmed using Processing, and produces the visual for Karma Fields’ ( New Age Dark Age debut album announcement.

Like Stickup, 1DDCB consists of multiple layers of quadtree structures, which recursively subdivide themselves to random patterns. The vertices of each cell within the quadtree are used as seeds to generate a layer of Voronoi tessellation, collectively forming a fragmental geometric chaos.


april 26th  / /  9:26 am

Revising in the most useful way for my extreme visual learning––making math beautiful : ) I gotta kick this exam’s ass to get an A in the class. Even though they’re somewhat redundant formulas I already knew, I can’t let anything slip through! Hopefully after this test I will be able to focus on other subjects I miss.