I started watching this video thinking, ‘oh that makes sense’ and then progressively got to a point where I was just thinking, ‘well, as long as he knows what’s happening!’ Great video!
@olli36866 ай бұрын
This is crazy. This is the 4th video in a row where you’re working on something that I’ve been working on 😂. My intention was to combine my weighted voronoi algorithm with these gaskets. Finding the center of each circle and giving it a weight.
@glenneric16 ай бұрын
Are you sure you aren't his sleep walking alter ego?
@hamyy65236 ай бұрын
the simulation saves some RAM by making us share memory 😂😂
@SarahMaeBea6 ай бұрын
Every coding train video I watch, pushes me one pixel closer to finally diving in to learning shaders. I don't know what P5 is, I just kinda translate it all to c# in my head, but the concepts and math are where the real magic is! Thank you for making these and making them so easy to digest! Your excitement is infectious.
@Crazyclay78YT6 ай бұрын
hes just using JavaScript, but a little different since its using the P5 library
@terrame15256 ай бұрын
If you get to learning shaders definitely check out shadertoy. It only has the pixel/fragment (the same thing) shader stage, yet it is a great way to start as it enables you to write code and play around with math without being bothered by all the boilerplatey vulkan or opengl bs.
@Varandru6 ай бұрын
You may be learning how fake the difference between languages is. It isn't totally fake, but it's definitely smaller than it may seem. Especially, say, object oriented ones
@kappasphere6 ай бұрын
you don't really need to dive deep in to get started with shaders. You can also just go to shadertoy and try some stuff out
@hirochima266 ай бұрын
i hope you're not on a 8k train XD
@Nightizm6 ай бұрын
This is fucking incredible. I'm just a measly web developer who definitely isn't good at math, but I was fully engaged watching you work through this 🤯 I'm so intrigued!!! Thanks for this great video!
@cashewABCD2 ай бұрын
You are a delight. Greatly appreciate your energy.
@footnuke4 ай бұрын
Oh man I am SO hyped i found your channel and website. This is 100% the kind of programming I've been looking for inspiration and guidance on, for so long! Can't wait to get into some math art deep dives ❤ thank you!
@realcygnus6 ай бұрын
👍That really was quite nifty Dan ! One of my favorites perhaps since that Fourier drawing thingy. MUCH thanks for doing what you do.
@65FM1Edits5 ай бұрын
Hey! I just wanted to say congrats for uploading for so long, I used to watch you when I was 7 years old, 8 years ago and I found you in my recommended again. Glad to see you're still energetic and making good videos :)
@NStripleseven6 ай бұрын
I feel like you might be missing some possible gasket configurations with your choice of third circle. For instance, what if that circle wasn’t directly opposite the second, but instead a bit to one side (and scaled down appropriately)? Then, if done right, you’d have 3 larger circles instead of the 2 or 4 you see in all of yours.
@the_kid7775 ай бұрын
2:38 That is precisely what I love about this channel. You know most channels, when reached a certain number of subscribers, become "official" in the sense that they have everything prepared, all clean and on the rails. But the Coding Train isn't, and that is what makes this train so fun to ride!! Keep uploading off-the-rail videos, please!
@A2ne6 ай бұрын
i made a version of bad apple using apollonian gaskets a while back, and my sloppy python code was so slow that it took like a minute per frame. This is giving me the motivation to finally improve that program.
@angelowentzler99616 ай бұрын
When you generate 3 random circles, 2 within the larger, the 2 inner circles don't necessarily both have their centers on a line with the big circle's center. You could (for instance) have 2 small circles sitting side by side on the inside of the big circle. This way you can have asymmetrical starting positions which should be neat.
@videosformyassignments21896 ай бұрын
I think the easier approach [O(n^2)] would be to use exponentials. Finding the angle and magnitude of each complex vector and normalizing one vector's magnitude with respect to the other would let you multiply (normalized magnitude)*e^(i*theta1) with (magnitude of the second vector)*e^(i*theta2). Meaning you would just be adding theta1 with theta2 and the resultant complex multiplication would become = "(normalized magnitude)*(magnitude of the second vector)*cos(theta1+theta2) + i*sin(theta1+theta2)" Great vdo! Loved it. I got a weak spot Decartes thm :D
@nosratullahmohammadi10986 ай бұрын
I really enjoyed watching this video. Thanks for your simple explanations throughout the coding.
@jamesgoodrich69276 ай бұрын
When you were debugging the descartes function, it was easy to forget that the bend values are signed, and thus can be negative. What eventually became the local product variable has a negative k1 value, because c1 always had a negative bend value, therefore, the sum of the k1 * k2 and k1 * k3 terms can have a significantly more negative value than what k2 * k3 might have as a positive value, for the intial invocation.
@0_-6 ай бұрын
I still don't understand why k1 has to be negative
@mareletudor6 ай бұрын
yaaaaay its pi daaaay!!! have a hapPI day, everyone!
@Amr-Ibrahim-AI6 ай бұрын
It was a pleasure watching this coding challenge, as always. The way you build up things is simply amazing. Thanks for the inspiration 🙏
@ringo27156 ай бұрын
This has been one of my favorite videos you've done yet
@johnborg3055 ай бұрын
Wow. We need more teachers in the world like you. I never went to school for coding but ive learned c, html, css, js, and python through free havard classes. It was very hard for me to understand code but the fact that you arent just reading off code as you go but you show the process of code and how to think it out. Absolutely beautiful content and keep doing what you do!
@SpencerBuchanan6 ай бұрын
I have been doing this as a zentangle with pen to paper for years! I have wanted to learn how to do this in code for a while now. The variation that I want to use this for is to have multiple circles draw a straight line by staggering them on either side. I want to overlay line drawings on this algorithm and let it follow those lines in the drawing, kind of like how you make images from the stipling technique you did in a recent vid. My daughters subbed to your channel on my account and I am glad they did. These are super helpful.
@odarkeq6 ай бұрын
I appreciate the amount of energy your thought process burns. I couldn't watch this in one sitting. Kudos.
@zariski6 ай бұрын
The video is very good. a good example of use is thinking about clusters of places in maps api. I did something similar a few years ago with OSM and Leaflet to add points outside of clusters and not overlap. Thank you very much for the excellent content.
@retrogamingfun4thelife6 ай бұрын
you could animate the Gasket by slowly changing the coords and the size of the first inner circle
@MyCodingDiary6 ай бұрын
This video is like a ray of sunshine on a cloudy day.
@sutyi066 ай бұрын
All of his videos are. I don't even know how to describe the vibe of these videos, but it's so good...
@flobiish4 ай бұрын
@35:00 allCircles[0] and [1] are the new internal ones. [2] and [3] are "new" external ones which happen to coincide with the outer circle. My initial instinct is to write a function to compare all the circles and return only unique ones, but due to the nature of the circles possible placements and the specific goal of the fractal, ignoring all outer ones is probably the best option...unless the starting circles aren't kissing. A consolidation array might be useful though.
@richarddjarbeng70935 ай бұрын
I found this channel yesterday from the book of shaders website. Looks like I'm a bit late to the party. However, it seems it's not too late and he's still releasing videos. I just hope some of the previous challenges (the Machine learning ones esp.) will still work. Also, keep up the good work.🙂
@BaronVonTacocat6 ай бұрын
Shout-out to F Soddy; the man made some poetry.
@CocoaBeans6606 ай бұрын
Hey man, just wanted to let you know you your videos are very entertaining and are a great source for me to improve at programming. I'm going to college next year for comp sci and you were a great inspiration.
@ethanhermsey6 ай бұрын
Dan, I've been watching you for so many years now. I wanted to let you know that the biggest thing you taught me isn't actually the code. I've thought for the longest time that I was too weird to be suitable for a serious job in programming. You showed me that it's okay to be weird and still deserve to be respected. I'll always be grateful for that ❤
@grumpyparsnip6 ай бұрын
This is my favorite coding challenge ever!
@Roger-rm3fz6 ай бұрын
Tack!
@rahulshastri92786 ай бұрын
Love your content!! Happy pie day to all.
@lydzzz5 ай бұрын
you made me understand coding. you are as iconic as bill nye the science guy
@subinaypanda99366 ай бұрын
Look how excited you were when the the complex thing works. I also love these mathematics and then implementing those in programs.
@Fuchspower5 ай бұрын
54:03 I tried to make sense out of this and this is what I suggest "went wrong": The paper you use the formula from is for the general case while yours implies that 2 circles are inside the bigger third one, giving the identity r1 = r2 + r3 (*) Also, this implies that all centers are on one line. By definition of curvature, we get k1 = -1/r1, k2 = 1/r2 and k3 = 1/r3. If we look at the radicant and replace k1-3, we get the following: k1*k2+k2*k3+k1*k3 = (-1/r1)*(1/r2) + (1/r2)*(1/r3) + (-1/r1)*(1/r3) = - (1/r1*r2) + (1/r2*r3) - (1/r1*r3) If we combine fractions, we follow with = - (r3 / r1 * r2 * r3) + (r1 / r1 * r2 * r3) - (r2 / r1 * r2 * r3) = ( - r3 + r1 - r2 ) / (r1 * r2 * r3). As we figured with (*), the numerator becomes 0, making the whole term calculate to 0. So basically, in your case, you could have skipped the square part entirely, at least for the first iteration. That's also why you got doubled circles in your first iteration initially. I guess the radicant became negative because some floating point inaccuracies, especially due to using random numbers. Actually, if we look at your debug, we do get a super small number, which also solidifies the assumption. As for further iterations, the square term is indeed needed, just to make this clear.
@RickClark586 ай бұрын
Very cool. I have never heard of these before.
@xavierfischer34996 ай бұрын
39:50 that moment expresses so well the joy of coding ❤
@TankorSmash6 ай бұрын
Thank you for reducing the sound of the 'error buzz' sound effect around 25:10!
@sentry49446 ай бұрын
Conductor stop the train. My brain hurts. But seriously, that is really cool math. I really need to start playing with P5.
@berdore6 ай бұрын
Super interesting and fun as always. Can’t wait for the 2nd edition of the book!
@linuss97106 ай бұрын
I come to your channel every PI-day knowing you upload something cool that day.
@mrpithon6 ай бұрын
Most coding challenges I watch, I believe I can also complete. This one... this one I won't even try. This was by far the most complicated Coding Challenge I've seen.
@SanthoshKumar-vd3bh5 ай бұрын
This dude is the coolest coding did ive ever seeen😂😂😂
@mattm8376 ай бұрын
Is there anything interesting about the invalid circles? It looked like they formed some kind of pattern. Great video, Happy Pi day!
@chroy_5 ай бұрын
great video, love your enthusiasm, its so contagious.
@aioia38856 ай бұрын
I used to watch your videos when I was still learning programming for the first time. It's really nice to see your videos continue to be so much fun and educational! Only thing that bothers me a little is that I don't think that every possible Apollonian Gasket can be generated in the way shown in the video. For example an Apollonian Gasket made by three mutually tangent circles of the same radius inside of the bigger circle won't be generated, unless I'm wrong about this. You could instead generate two different random points inside the big circle and try to find their radii knowing they are tangent. It requires solving some equations but it's not too hard if I remember correctly. Edit: just noticed that some people might have already pointed this out, sorry if this comment was repetitive
@vernonturner31136 ай бұрын
Make it tall and have an Apollonian Gasket pencil holder.
@ValleyOfWillows6 ай бұрын
A thought occurred while checking the part about complex numbers (don't know if it's true): If you would add the radius of the 4th circle to the radii of the circles with a positive curviture + if you would subtract the radius of the 4th circle from the radii of the circles with a negative curviture, then the points where those 3 new circles dissect should be the center points of all possible positions for the 4th circle.
@dimBulb56 ай бұрын
Brilliant and fun as always! Thanks! 😃
6 ай бұрын
I literally love you, thank you so much I have sooooo much fun with you ❤❤❤❤❤
@TheXtrembug6 ай бұрын
If only I'd had a teacher like you, many things would have gone differently for me
@davidrop4 ай бұрын
I get that you have your awesome job, but here on youtube you have 1.6 Million students waiting for the new lesson. Imagine that if I meet someone who wants to learn to program I tell them "watch all the coding train videos to get started". I say at least for Coding train's birthday on July 10th you could give us a surprise :D
@mitromanzukal92166 ай бұрын
This is a very great video and I enjoyed watching it. But on a side note: you missed some solutions. The square root of a complex number has two solutions. The other solution is rotated by pi. And the angle of a complex number can not only be defined by tan, because then you would miss the edge cases and certain rotations (e.g. -b / -a) Edit: The +/- infront of the square root is already the rotation py pi.
@KX364 ай бұрын
just started thinking about how many kissing ellipses you can have for a number of separate initial ellipses, and it's pascal's triangle.
@colebot6 ай бұрын
I never thought I would read a poem describing a mathematical theorem
@PMA_ReginaldBoscoG6 ай бұрын
Dear Dan, please make a 3d version of the Apollonian Gasket. I would be happier if you did it.
@larswilms82756 ай бұрын
Do you really want to see Dan struggle with quaternions? Give the man a break, he's a coding art teacher not a coding math teacher.
@tomiscattini6 ай бұрын
I love your videos, thank you!
@MrBadSmash6 ай бұрын
Just want to let you know that, for me, it's fine when you take a long time to start coding. I don't watch you JUST to watch you code--I love the math, too!
@DeathSugar6 ай бұрын
Can you make gasket out of N initial EQUAL circles, not just 2?
@geoffwagner49355 ай бұрын
2Blue1Brown did 2 transformations videos the last week, now I'd kind of like to see maybe more transformations videos on coding train. You also said you intended to possibly go into more "extra dimensional that couldn't be visualized". not that anyone's expecting all that , the transformations theme seam fun though , or an unreal engine lol both :) do a "Shiff Sims" with transformations "the ring" technology from "autoencoder", all three.
@gownerjones6 ай бұрын
My pet theory why it is called a gasket: The outer ring seals everything inside but the inner surface consists of infinite holes, so is infinitely porous, it lets everything through. Sealed at the edge but open in the middle is exactly what a gasket should be like.
@vincentcaliendo64025 ай бұрын
It’s Vincent from NYU. Dekalb Q train. Music and Programming
@dougmcfarlane5 ай бұрын
Next, modify the code to work with 3D spheres, instead of 2D circles. I would expect adding a 'z' component wouldn't be that difficult, but then I didn't understand about 25% of what you were saying towards the end, especially the Complex number portion. Fun stuff.
@wonghw6 ай бұрын
It is an incredible tutorial
@letsgocamping886 ай бұрын
Really enjoyed this one!
@MyCodingDiary6 ай бұрын
I wish I could give this video more than one like. It's that good!
@warny19786 ай бұрын
Wonder about doing it with spheres ?
@joshuawhitworth64566 ай бұрын
I made one in apophasis 7x that is a gasket fractal with infinitely more gasket fractals inside of it. I called the orb fractal.
@kasperchristensen84166 ай бұрын
When multiplying imaginary numbers, I'm pretty sure it's not A2B2, but rather R2D2 🤖💫
@juljanhaka70866 ай бұрын
Nice! Now, it is interesting if you set that gasket as various systems with their corresponding attributes and apply hysteresis.
@leeblackharry6 ай бұрын
Instead of drawing the circles it would be interesting to see what kind of line path would result from connecting the centers of 3 circles to the new circle.
@cuadernoazul59586 ай бұрын
Wow a new CT's video! Its party time
@tomek36336 ай бұрын
And as usual: "I will refactor this later ..." *singing*
@refaldybagas6 ай бұрын
Beautiful
@dominick2535 ай бұрын
You should do a leet code live stream. See just how quickly you can do them.
@alvarofuenzalida27536 ай бұрын
I'm waiting for the new version of the book!
@moodangelatx65806 ай бұрын
Good stuff
@mariobroselli36425 ай бұрын
Hello @thecodingtrain , thanks for the Videos. Processing is amazing. Are there languages similar to it? Also are there any videos on Java and Processing?
@StefanReich6 ай бұрын
54:05 Look at the value, it's E-21, so very close to zero. Probably it's a rounding error and just supposed to be zero
@alexsandergutierrezgoncalves6 ай бұрын
Happy PI day to all
@koktszfung6 ай бұрын
This is why we code
@geoffwagner49356 ай бұрын
On my Raspberry Pi 5, on Pi Day, on Dan's Pi challenge, and comment #10! Just did last Pi day yesterday and commented I hope we have another Pi day stream, happy to see an isn't a spoiler and ignored my comment. If he had loved it would not have been a surprise
@louamacademie58375 ай бұрын
You are making a wonderfull easy to learn videos Thank you so much And i really want to ask you for a ml5 handpose video I would love to apply what you teached us in posenet in a handpose project ❤ Hope you find the time for that :")
@DarylJewkes6 ай бұрын
Happy Pi Day, Dan!
@harrywizards33236 ай бұрын
i have learnt a lot from your vedio but i cant implement anything by myself what do i do?
@DipamSen6 ай бұрын
Happy π day!
@frollard6 ай бұрын
Excellent work! Is it necessary for the 3rd circle be exactly rotate-by-pi opposite 2nd circle? In theory it just needs to be mutually tangential...it's just symmetric if you rotate 180 degrees.
@jaymistry6895 ай бұрын
I just have one request, make a coding challenge for linear transformation visualization of 2d grid, because I want to do that but I am stuck at one problem of finding the edge of curved line, I know the math but I can't implement it in code, plzzzzzzzzz
@Maukustus5 ай бұрын
im more familiar with C++ than js so i thought overloading the operators for the complex number class could work
@kamilsobczak2436 ай бұрын
awesome!
@geoffwagner49355 ай бұрын
Remember the 1998 3d windows desktop? maybe it was an earlier "3dna desktop" i remember a slightly different version than first comes up on google, make a unreal ShiffBot Coding Desktop assistant
@garthmacleod6 ай бұрын
Had a beer. Brain broke.
@NonTwinBrothers6 ай бұрын
Damn, and my copy of Indra's Pearls just arrived. What coincidences 😳
@juancer_6 ай бұрын
happy pi day!!!!!! 🚂🚂 🚂
@stickmasterlukeRBX3 ай бұрын
When we consider each circle filled in, does the Apollonian Gasket have any free space? Also, if I wanted to roll one of the circles, would it lockup or all start spinning?
@geoffwagner49356 ай бұрын
wow, center.x, center.y to center.a and center.b my life fell apart lol i have been console logging objects for hours .... i stuck push(newCircle, c1, c2, c3) and validate(newCircle), and couldn't figure out why i was getting undefined out of my circles dist function, it was empty lol
@justusalho3916 ай бұрын
Dan could be a scientist played by Jeff Goldblum
@thenormalguy85746 ай бұрын
i love pi day!
@rubenvanderark49606 ай бұрын
Happi pi day
@trejkaz6 ай бұрын
Oops, this was how I spent my day, although it's the day after half-tau day for me.