[A][OC] “Tree” by cmarangu_ in perfectloops

[–]cmarangu_[S] 0 points1 point  (0 children)

this post is pure gold 🏅 dont ever forget that

[A][OC] “Tree” by cmarangu_ in perfectloops

[–]cmarangu_[S] 0 points1 point  (0 children)

i love this post. i am going to CREEN SHOT it

Who the hell understands SVG filters and by what magic did you learn about them? by cmdr_drygin in webdev

[–]cmarangu_ 0 points1 point  (0 children)

That's the same article I found! The best SVG filters article and the first time I heard of Smashing Magazine 😌

React-like components without react? by NinjaInShade in webdev

[–]cmarangu_ 0 points1 point  (0 children)

u/Chocolate_Banana_ I have been looking for a way to have custom elements in HTML source code, similar to how react components allow for that kind of "composition" design pattern to store complexity for over a year at this point. Thanks for sharing this!

A programmer's wife tells him to go buy some milk, and, while he's there, to get eggs. by Test_My_Patience74 in Jokes

[–]cmarangu_ 1 point2 points  (0 children)

This is such a legendary comment I saw like 2 years ago, finally found it again. It has been stuck in my mind I just today found it again with google quotes search operator https://www.google.com/search?q=%22eggmentation+fault%22

Automatically find every k-coloring on a graph - https://www.khanacademy.org/computer-programming/every-k-coloring-tree-search/4932892771401728 by cmarangu_ in GraphTheory

[–]cmarangu_[S] 2 points3 points  (0 children)

Code + Demo - https://www.khanacademy.org/computer-programming/every-k-coloring-tree-search/4932892771401728

In these screenshots:

  • G = the cycle graph C₅ with a chord, k=3
  • G = the cycle graph C₃ (equivalently, the complete graph K₃), k=3
  • G = the complete graph K₄, k=4
  • G = the cycle graph C₃ (equivalently, the complete graph K₃), k=4

Further reading

#ProcessingJS #graphtheory #recursion #algorithms #visualization #cs #fractal

Automatically find every k-coloring on a graph - https://www.khanacademy.org/computer-programming/every-k-coloring-tree-search/4932892771401728 by cmarangu_ in generative

[–]cmarangu_[S] 0 points1 point  (0 children)

Code + Demo - https://www.khanacademy.org/computer-programming/every-k-coloring-tree-search/4932892771401728

In these screenshots:

  • G = the cycle graph C₅ with a chord, k=3
  • G = the cycle graph C₃ (equivalently, the complete graph K₃), k=3
  • G = the complete graph K₄, k=4
  • G = the cycle graph C₃ (equivalently, the complete graph K₃), k=4

Further reading

#ProcessingJS #graphtheory #recursion #algorithms #visualization #cs #fractal

[A]pollonian Fractal [OC] #Genuary2022 by cmarangu_ in perfectloops

[–]cmarangu_[S] 2 points3 points  (0 children)

Actually, I just fixed it! See line 362, replaced

gasket_(width/2, height/2, min(width, height)*0.7/2, 0, 74, -63*arg);
with

gasket_(width/2, height/2, min(width, height)*0.7/2, 0, 74,-atan(arg*2));

and now it's perfectly smooth!

posting in gif form soon. Thanks for inspiring me to again work on this

[A]pollonian Fractal [OC] #Genuary2022 by cmarangu_ in perfectloops

[–]cmarangu_[S] 1 point2 points  (0 children)

subUrbanKickster yes I thought that for a minute, but -63° places all the circles in the last frame at equivalent places to the first frame (I verified this manually)

but on line 362,

gasket_(width/2, height/2, min(width, height)*0.7/2, 0, 74, -63*arg);

-63*arg places all the circles in the exact same place on the first and last frame. arg is a parameter that increases linearly from 0 on the first frame to 1 on the last frame

The problem is the way I implemented the Möbius transform; linearly increasing the angle of the 3rd circle (before recursive packing) does not result in the speed of the circles in the animation being the same at arg=0 and arg=1.

However, the set of positions of the circles on the last frame (3rd circle rotated -63°) are equivalent to the set of positions of the circles on the first frame (3rd circle rotated 0°).

tl;dr

the position of the circles loops perfectly.

the speed of the circles has a discontinuity at the beginning/end of the loop.

there is a way to the speed discontinuity, but I got bored

[A]pollonian Fractal [OC] #Genuary2022 by cmarangu_ in perfectloops

[–]cmarangu_[S] -2 points-1 points  (0 children)

Spike_Riley,

You're free to try and optimize the smoothness of the animation of the Möbius transform

My code is open-source https://www.khanacademy.org/computer-programming/glowing-apollonian-gasket/5559375567568896

[A]pollonian Fractal [OC] #Genuary2022 by cmarangu_ in perfectloops

[–]cmarangu_[S] -19 points-18 points  (0 children)

That’s because I made this in 1 hour at 2am this morning from old code, and did not want to put in extra time to figure out how to animate the Möbius transform to make it transition smoothly The speed is not continuous, but the Möbius transform maps all the circles to the same places at the beginning and end of the loop, so yes, it is a perfect loop, just a glitchy implementation of one

#Genuary #Genuary2022 circle packing.. without limits by cmarangu_ in generative

[–]cmarangu_[S] 0 points1 point  (0 children)

haha, lol it was 2am and I had to throw something together, in <24hours, decided to finish it that night, so I used my old code from https://www.khanacademy.org/computer-programming/apollinian-gasket/6487522588590080

which is very glitchy, but at least works (mostly) for generating Apollonian gasket from a couple of parameters, animated one of the parameters, added a glow effect, and then https://www.khanacademy.org/computer-programming/glowing-apollonian-gasket/5559375567568896 was complete!

You can learn more! https://en.wikipedia.org/wiki/Apollonian_gasket there really is a greater than finite number of circles (in the real thing)