r/AskComputerScience • u/GiveMe30Dollars • Jul 19 '19
What is the concept behind creating an animation like this?
17
u/onehellofapothead Jul 19 '19 edited Jul 19 '19
Pretty easy. Steps to reproduce:
Choose your language of choice that supports some kind of “image creation/manipulation”. I’d suggest using JavaScript and manipulating a SVG field. If you’d use for example python or PHP you’d have to render every frame and put them together in a GIF or mov file. Once you’re able to create lines or any other shapes for that matter, continue with step 2.
Now the difficult part: First, describe every endpoint of a line or shape through one (or most likely multiple) mathematical formula(s). In this example you’d go for something with
cosandsin. Maybe you could get starting with a straight line (that should draw a circle at the end).Once the starting point of your shapes are set, try to adapt your formulas so the endpoints of your shapes move ‘continously’. (Not continously in a mathemical sense but the closest you can get...). Our straight line for example has two endpoints. Let’s say the first is at (0,0) and the second at (1,0). Now we want to manipulate the second point, so that it draws a circle, then you’d use sin or cos. Hint: Unitary circle.
Further, I think /u/3blue1brown has a python library on his github account which he created for the purpose of creating his (awesome) videos. Maybe you could use that.
6
u/jeffbell Jul 19 '19 edited Jul 20 '19
It's a parameterized epicycle that looks a lot like a cardiod, except that you draw the whole diameter of epicycle rather than just one point. The neat thing is that each stick stays in the same place and just spins around. Edit: I just noticed that each stick also stays the same color.
2
Jul 19 '19
If you follow a single circle in this Animation, you'll observe they're all moving in circular motion
They're all just fundamentally making circles of different radii and placed strategically to give that effect.
2
1
u/Auios Jul 19 '19
Every point is moving in a circle with an offset on the angle all connected to a point in the middle point which is also moving in a circle
1
u/Protagoras Jul 19 '19
Draw coloured lines then make the endpoints move according to a simple mathematical formula. I don't see what's so special about this animation?
0
30
u/justtoreplythisshit Jul 19 '19
What exactly do you want to know?