📜 ⬆️ ⬇️

Multiplication tables ... kind of

Foreword
This post is a brief retelling of this video in English.
If there is no time to read - a living example is here . In the factor field you can substitute any non-negative values. My favorites are 51, 99, 106, 134, 150.


Math never ceases to amaze with its beauty. This post is about how to turn such a simple operation as multiplication into something amazing. Now answer the question - what is common between these pictures?






All of them are created using only one operation - multiplication (in fact, still taking the remainder). How so, because they look so complex and different?
')
The algorithm is quite simple - draw in a circle N points at the same distance from each other. The more points, the richer and brighter the final result will be. In the examples, N = 200. All of them are denoted by numbers from 0 to N-1. Then we choose any non-negative number (now for simplicity we take a natural number). Let it be 2. Now for each point we will do this - take the number that we have identified and multiply by 2. We get a new number from 0 to 2 (N-1). This number will denote another point with which we connect this line. Point 0 will be connected with itself, point 1 with point 2, point 2 with 4, 3 with 6, etc. So we will reach the point with the number 100. Multiplying 100 by 2 we get 200 - and we don’t have a point with such a number. The most logical thing to do is to take the resulting number modulo N, i.e. in our case 200, and get 0. So we connect the 100 point with 0.

As a result, we will have such a figure, also called a cardioid, because of its similarity with the image of the heart.



Now you can choose any numbers from 0 to N (after N the figures begin to repeat) and look at the result. What to do if we chose a fractional number? The answer is also simple - after multiplying, round the result down. As a result, when choosing numbers 2.1 and 2.2, the figures will hardly differ, however, with a further increase (2.3, 2.4, 2.5 ... 2.9), they will increasingly resemble the figure obtained by choosing number 3. This creates an animation effect that you can observe in the interactive example , setting the factor to 2 (the number by which we multiply) and speed to 0.02 (the value that is added to the factor every frame).

When choosing factor = 3


Share your interesting factors. Thank!

Source: https://habr.com/ru/post/274471/


All Articles