Warning: LONG post follows. For the impatient, tl;dr-type readers, at the end of the post there is a link to a cool animation that visually captures the entirety of this post![...]
WRAPPING IT UP: COMPRESSING THE SPIRAL — VIDEO ANIMATIONFor some cool eye-candy, here is an animation I created, which shows the entire process of "compressing the spiral", from 4 weeks all the way up to 4 years! Everything in this animation is generated by MATLAB code and is a result of numerical calculations. Nothing has been added after the fact. Kudos to MathWorks for creating such a powerful and efficient numerical analysis tool—always a pleasure to use.
Bitstamp BTC/USD Polar Chart Animation | 28/11/2014 ~ 07/06/2022 (2749 days)Enjoy!
Thanks for that.
Relatively few people will click a link. Thus, after what it took to scrunch this into an embeddable preview GIF under the forum image proxy’s size limit (finally!), I hope this does not offend the visual perfectionist I know you are:
The video is much better. Direct link, for those who do not want to load Imgur’s
Javascript web app:
- https://i.imgur.com/4LZJTpT.mp4 14.42 MiB. (Copy and paste the link to view/download. Imgur will probably redirect if it gets a referral header from here.)
Do you have any interest in sharing the source? If not, I’ll STFU. Unlike HoDLers who don’t mess with margin, I am too poor to have fancy proprietary software like MATLAB; but I am curious to read and understand what you did—maybe someday port it to another language, if I were to become obsessed with it.
Many thanks for taking the time to convert the video to an animated GIF. It does help in providing an instant view of the animated spiral compression, albeit of much lower quality than the full video.
I've already edited my original post, and provided the MATLAB source code, as you requested. I considered including it when I first made the post, but thought that no one would care to see it. I'm glad that someone does! You can port it to another language, but you'll need to write (or find libraries of) appropriate functions for the polar plot generation, vector/matrix manipulation, and video capture/recording. With MATLAB, all of this is provided. As for the spiral compression algorithm I used, it's rather straightforward, I'm just mapping the entire spiral's linear time to an angular vector, and varying (increasing) the days/cycle amount at each frame, thus compressing the spiral. All this is done in just a single line:
th = 2*pi*(i-1)/c+pi/2;where
th is the angular vector,
i is the linear time vector,
c is the days/cycle amount (the cycle period), and the π/2 term is just to rotate the end of the spiral from the 3 o'clock to the 12 o' clock position in the polar plot. The rest of the code is just for the visualization and video capture.