5 ms·
T * sin (t) ≈ Christmas tree
- sjg0 8y agoVery cool! Simple and elegant.
- adamnemecek 8y agoObligatory mention that this shape could also be represented as a dual quaternion.
- ars 8y agoAnd is a dual quaternion simpler than a sine wave?
- adamnemecek 8y agoIt’s more general and composes nicely.
- DonHopkins 8y agoAn octernian? There should be a unicode "sextuple-u" character so you can express "www" in one letter (and five fewer syllables). Think of all the time and bandwidth that would save!
- adamnemecek 8y agoNope, it’s not an octonion, it’s a dual quaternion. The nice think about dual quaternions is that they compose. So you could then connect this screw to another screw in a smooth fashion.
- docbrown 8y agoNeat idea. Hidden within the ReadMe file, someone re-wrote this tree in Wolfram but made it ornamented looking. [0] Going further, the same author of the latter tree had a post picked by staff titled “Random Snowflake Generator Based on Cellular Automaton.”[1] Another very cool idea for this time of the year. [0]https://community.wolfram.com/groups/-/m/t/175891 https://community.wolfram.com/groups/-/m/t/175891 [1]https://community.wolfram.com/groups/-/m/t/235291 https://community.wolfram.com/groups/-/m/t/235291
- shawn3 8y agoReddit thread from 4 years ago: https://www.reddit.com/r/programming/comments/1tswai/t_sin_t_christmas_tree/?st=JQ4CPBMT&sh=7574f3bc https://www.reddit.com/r/programming/comments/1tswai/t_sin_t... The neat thing is that /r/programming chipped in like a stone soup and improved it. It’s surprising how small tweaks can make a big difference in rendering quality.
- klipt 8y agoe^it is a spiral. t*e^it wraps the spiral round a the cone |x|=t.
- ZenPsycho 8y agohttp://dwitter.net http://dwitter.net has rad minimalist christmas trees every year. best bit is it’s easy to remix them!
- jen729w 8y agoHow on earth does this one work? The code is just a bunch of escaped kanji?! https://www.dwitter.net/d/11506 https://www.dwitter.net/d/11506
- gizmo686 8y agoIt is not just kanji. For instance, the 3rd character is ⡸ (a braille character). I suspect what happened is that the author choose the characters needed based entirely on their unicode value, and it just so happened that many of them fell into the kanji region of Unicode[0]. Anyway, what is going on is that each character takes 4 decimal digits to encode its Unicode value. When you escape it, the characters are replaced by their unicode values expressed in decimal, so the string looks like: "%u7769%u7468..." At this point, it uses a regex to change it from being a sequence of 4 hexadecimal digit characters to 2 hexadecimal digit characters, so the string becomes "%77%69%74%68%..." At this point, it escapes the string. Giving the intended script of with(x)for(j=c.width=412+S(t/2)*98;v=j--<<3;beginPath(fill()))for(i=5;i--;clearRect(a*a%712,t*v%400,i,3))fillStyle=R(j/2,98-v,j<98?190-v:j),lineTo(98+S(a=i*98+v+t/8)*v,80+C(a)*v+v-j/2) Essentially, what is going on is that the rules state there is a 140 character limit. Most people interperat that as a 140 byte limit, however, in exchange for 48 bytes of overhead, you can actually pack 2 bytes into a character, which gives 184 bytes of usable payload. Which is good for this submission, as the unencoded payload is exactly 184 characters (and 184 bytes). [0] A quick search says that 4E00-9FFF is CJK (Chinese, Japanese and Korean) Unified Ideographs, and that is not the only Unicode block that seems to be devoted to CJK. Combined with the fact that that the lower ascii characters are control characters that would't be used in a script, and you end up with almost all CJK characters. If you actually wanted to be entirely CJK, it probably wouldn't be that difficult to fudge the characters around so it fits.
- TazeTSchnitzel 8y agoIt's abusing Unicode character counting to fit more bytes of source code.
- yantrams 8y agoNice. A spiral with decreasing radius essentially. On a side note, I wonder what configuration/distribution of magnetic force will make a charged particle move like this.
- theunamedguy 8y agoA charged particle moving at an angle to a magnetic field like that found at the ends of a solenoid (increasing field strength) would produce the desired motion. Example: https://s3-us-west-2.amazonaws.com/courses-images/wp-content/uploads/sites/1989/2017/06/13230250/figure-23-05-04a.jpeg https://s3-us-west-2.amazonaws.com/courses-images/wp-content...
- yantrams 8y agoThank You! I'll explore it soon when I get some time.
- GeorgeKangas 8y agoSuggestion: to make the tree self-similar at the vertex point, use [x, y] = t * [cos, sin] ( k * ln(t) ). The constant k determines the tightness of the spiral winding. Another way to describe it: the spiral's uphill slope stays constant.
- tokyodude 8y agoInspired by this I threw this together (warning: contains music) https://www.vertexshaderart.com/art/rBjrdN2CvsneEkgEk https://www.vertexshaderart.com/art/rBjrdN2CvsneEkgEk Yea, too much code but I'm lazy Here's a smaller one https://www.vertexshaderart.com/art/uDBqerAHTiHEjQMdR https://www.vertexshaderart.com/art/uDBqerAHTiHEjQMdR but it's missing the motion at the moment.
- DonHopkins 8y agoIf you appreciate other kinds of trees, here's a fractal pot leaf written in PostScript: https://www.donhopkins.com/home/archive/NeWS/leaf.ps.txt https://www.donhopkins.com/home/archive/NeWS/leaf.ps.txt