Squaring the circle

Sdílet
Vložit
  • čas přidán 27. 04. 2021
  • The evolution of a wave front in a square domain, in the approximation of geometric optics (that is, without any dispersion or interference between the waves). In fact, the evolution of the curve is quite simple to obtain: take a circle with radius proportional to time, and as soon as it leaves the square, fold back, as often as needed, all parts of the circle that are outside the square. A more realistic simulation with dispersion and interference is here: • Low sea in the square ... - you can try comparing the shape of the wave fronts in both simulations.
    Music: Down The Street Blues, by Unicorn Heads‪@UnicornHeads‬
    Current version of the C code used to make these animations: github.com/nilsberglund-orlea...
    www.idpoisson.fr/berglund/sof...
    Some outreach articles on mathematics:
    images.math.cnrs.fr/_Berglund...
    (in French, some with a Spanish translation)
  • Věda a technologie

Komentáře • 305

  • @Mechanarian
    @Mechanarian Před 3 lety +412

    I love thinking about stuff like this, like how if you think about it the lines are just getting straighter because the circle is still getting bigger and bigger but it’s all just squished into this little box

    • @jonathanwalther
      @jonathanwalther Před 3 lety +33

      Exactly my thought! All the linesegments have the same curvature. What a revelation. Basically you could fold it up to circle.

    • @7rodo
      @7rodo Před 3 lety +6

      mindustry gamer

    • @Mechanarian
      @Mechanarian Před 3 lety +1

      @@7rodo ayyy

    • @thatreallycooluser9663
      @thatreallycooluser9663 Před 3 lety +2

      @@Mechanarian ayyy

    • @monsieur2761
      @monsieur2761 Před 2 lety +1

      @@thatreallycooluser9663 ayyy

  • @enescoskun0123
    @enescoskun0123 Před 3 lety +278

    I love how that one line becomes more and more straight as it hits the edge

    • @alexpotts6520
      @alexpotts6520 Před 3 lety +53

      Makes sense, if the square weren't there it would just be a circle expanding forever, and a really big circle looks like a straight line close-up

    • @daniel_schmidt.
      @daniel_schmidt. Před 3 lety +15

      Wow good points. I have not thought about that. But yeah, its actually just one single line...

    • @nadrewod999
      @nadrewod999 Před 3 lety

      That's the outer edge of the circle.

    • @coolbionicle
      @coolbionicle Před 2 lety

      @@alexpotts6520 Exactly! since the circle started in the middle it's basicaly still ther, just being folded over and over again to fit in the square.

    • @olimar6738
      @olimar6738 Před 5 měsíci +1

      ​@@coolbionicle And as another person stated in the comments, if you combine all the lines, you get a very big circle

  • @ManOfTheWeek596
    @ManOfTheWeek596 Před 3 lety +487

    Would love to see what this would look like when the start is in one of the corners instead of the middle

    • @FenrizNNN
      @FenrizNNN Před 3 lety +7

      Same

    • @denyraw
      @denyraw Před 3 lety +38

      It would look exactly the same as any of the 4 quarters of this square

    • @JB-ey1ef
      @JB-ey1ef Před 3 lety +2

      Would that change the focal point?

    • @derekbauer2125
      @derekbauer2125 Před 3 lety +1

      @@denyraw why?

    • @Mechanarian
      @Mechanarian Před 3 lety +2

      @@derekbauer2125 because all the corners of the square are the same

  • @Mooncat25
    @Mooncat25 Před 3 lety +41

    Fun fact: if you connect all the lines, they still form a circle. The circle is there. It is just very big.

  • @crpineo
    @crpineo Před 3 lety +161

    Aaaand now I have _"All these squares make a circle, all these squares make a circle, all these..."_ stuck in my head again

    • @chamberkingston7609
      @chamberkingston7609 Před 3 lety +12

      That's what happens when youchug a literal gallon of LSD

    • @crpineo
      @crpineo Před 3 lety +6

      @@chamberkingston7609 and we still don't know where he even _got_ that milk jug
      ...and now we never will...

    • @mewxtherealitygod4706
      @mewxtherealitygod4706 Před 3 lety +2

      Kami: mr popo
      Mr popo: BITCH DONT TELL ME WHAT TO DO!!!

  • @2001herne
    @2001herne Před 3 lety +115

    The cool thing is that if you let your eyes drift it sometimes looks like a rotating cylinder.

  • @lilapela
    @lilapela Před 3 lety +29

    It's like having an infinite grid of squares like this with a circle expanding from the middle of each one, except the circles pass through all the boundaries without reflecting. This video is looking at one of the squares

  • @natekite7532
    @natekite7532 Před 3 lety +32

    This is my favorite one yet, the geometric patterns are soo pretty

  • @1SLMusic
    @1SLMusic Před 3 lety +45

    4:50 is an accurate depiction of modern art

    • @StickRaccoon
      @StickRaccoon Před 3 lety

      nice

    • @brycee.5121
      @brycee.5121 Před 3 lety +2

      a beautiful stunning display of man's ability to find beauty in the abstract?

    • @panthererousse
      @panthererousse Před 2 lety

      @1SL So you mean being high?

    • @asheep7797
      @asheep7797 Před 2 lety

      Mathematical?
      Pfft, I don’t think so!

  • @pppfan103
    @pppfan103 Před 3 lety +62

    I wonder if, when given enough time, it'll go back to how it started

    • @nanamacapagal8342
      @nanamacapagal8342 Před 3 lety +50

      It won't. As the circle grows larger its edges become straighter. So there's no way to go back to having a small curved edge rather than a long straight-ish edge

    • @NilsBerglund
      @NilsBerglund  Před 3 lety +89

      Indeed, it won't go back, since the length of the curve increases linearly with time. However, for an approximation like here that has finitely many pixels, Poincaré recurrence tells you that you will at some point go back - but the time required for that can be extremely long, something like the Nth power of 2 where N is the number of pixels.

    • @felynecomrade
      @felynecomrade Před 3 lety +5

      Nope, never. The number of lines only increases, never decreases. At the start there was 1 line that formed the circle. Then there were 8 lines when the circle first reflected. It will never go back to just 1 line.

    • @JPK314
      @JPK314 Před 3 lety

      @@NilsBerglund Poincare recurrence only holds if f is measure-preserving - I don't think it is in this case

    • @NilsBerglund
      @NilsBerglund  Před 3 lety +3

      The dynamics is measure-preserving in phase space, that is, you have to consider both position and velocity (or momentum)

  • @StellariaEclipse
    @StellariaEclipse Před 3 lety +15

    This is what it would look like if every idle TV's logo bounced on the corner every time

  • @maevixie7041
    @maevixie7041 Před 3 lety +21

    This is how I'm gonna imagine 4d rotation from now on

  • @NKY5223
    @NKY5223 Před 3 lety +25

    i think im addicted to this..

  • @nanamacapagal8342
    @nanamacapagal8342 Před 3 lety +15

    How do you deal with the points of the circle that hit the corners?

    • @NilsBerglund
      @NilsBerglund  Před 3 lety +12

      That's a good point. One can show that for polygons with angles in Pi/n (n = 4 here), there is a well-defined limit when approaching the corner from either side. For right angles, the particle is simply turned by Pi: it reverses its velocity. For other angles, however, the limit is not necessarily well-defined, and strange things may happen...

  • @Yezpahr
    @Yezpahr Před 2 lety

    I love how eventually it just produces an anti-circle. So many gunk on the outside that it produces a near-round shape while having pure serenity and blankness in the middle.

  • @asheep7797
    @asheep7797 Před 2 lety

    4:43 i just love how well defined that polygon in the middle is, it’s so close to a circle!

  • @K4i_x
    @K4i_x Před 3 lety +18

    U earned a sub! I hope this will start in somewhere else than the middle thought. Good video! :D

    • @NilsBerglund
      @NilsBerglund  Před 3 lety +3

      Thanks for subbing

    • @K4i_x
      @K4i_x Před 3 lety +1

      @@NilsBerglund your welcome! :3

  • @wigwagstudios2474
    @wigwagstudios2474 Před rokem +1

    if you take a sine + cosine wave and put it on one of those funky self-folding waveshapers and gradually increase volume without clipping its pretty much just this on xy oscilloscope mode

  • @konstantinospalapanidis6414

    A nice demonstration of a spherical wave being approximated by a plane wave substantially far away from the source.

  • @Allen-cx6yi
    @Allen-cx6yi Před 3 lety +2

    Normal people: **watches in normal speed**
    Me an intellectual: **watches in 2x speed**

  • @tundrummax6221
    @tundrummax6221 Před 3 lety +1

    i think it would be interesting to have an animation at the end of the video that shows you linking all these lines together to recreate the original but enlarged circle

    • @NilsBerglund
      @NilsBerglund  Před 3 lety

      Thanks, I'll look into it. Some videos like czcams.com/video/JLywMk-AGPo/video.html give an idea by looking at a particular angle.

  • @uhhok8296
    @uhhok8296 Před 3 lety

    This is incomprehensible, thanks

  • @shybound5905
    @shybound5905 Před 3 lety

    ive asked for this video before, and you delivered! thank you so much

  • @jacob01711
    @jacob01711 Před 3 lety

    I love when that single drawn line of circle went chaotic real quick

  • @sardobi
    @sardobi Před 3 lety

    Really interesting & great choice of music!

  • @bartybum
    @bartybum Před 3 lety +4

    Is there any chance that you could give the lines transparency so that when the colour of the overlap is the average of the overlapping line colours, and symmetry is better preserved?

    • @NilsBerglund
      @NilsBerglund  Před 3 lety

      It would be hard to do "by hand", but OpenGL might have some functions allowing to do that. I'll have to look into it, thanks for the suggestion!

  • @MsSteelphoenix
    @MsSteelphoenix Před 2 lety

    This is very calming.

  • @fellowweeb2882
    @fellowweeb2882 Před 3 lety +2

    This is so hypnotic

  • @luzelenaserrano1236
    @luzelenaserrano1236 Před 3 lety

    Ngl I wanted the video to last longer, I wanted to keep watching the evolution
    This is sO cool

    • @NilsBerglund
      @NilsBerglund  Před 3 lety

      Glad you enjoy it! The length is often limited by issues of numerical precision, time needed to make them, and memory. But I plan to make more software available, so people can make their own versions.

  • @ChamomilleMilk
    @ChamomilleMilk Před 3 lety +3

    Do you like how my circle desintegrates into square?

  • @slipknotfya
    @slipknotfya Před 3 lety

    I appreciate the length of this video

  • @braydenbanks4228
    @braydenbanks4228 Před 3 lety

    "All these squares make a circle, All these squares make a circle..."-Mr. Popo, DBZ abridged

  • @a-s-greig
    @a-s-greig Před 3 lety

    First contact: 0:08
    Corners pinch: 0:11
    Four-Leaf Clover/Petunia petals: 0:15
    Spanish Cross: 0:21
    Propellers: 0:34
    NICE octagon: 0:50
    (and my brain shuts off right around there. :T)

  • @lurvonc.7097
    @lurvonc.7097 Před 3 lety +1

    CZcams recommendations: Squaring the circle?
    Me: why would I- ... interesting... what about, circling the square🤔🤔?

  • @rogerkearns8094
    @rogerkearns8094 Před 3 lety

    Fascinating evolution!
    I think this example of your work might be particularly effective if presented with imposed op-art style black and white dual shading. Not sure how easily you can do this, though.
    Best wishes anyway.

  • @birthdaydinosaur
    @birthdaydinosaur Před 3 lety

    i like how that one shape in the middle keeps adding more sides after each cycle. eventually it will look like a perfect circle

  • @injusticevideos9459
    @injusticevideos9459 Před 3 lety

    its interesting to see how, as the circle is just spreading out, the lines start to look straight, but they aren't, they are just smaller and smaller segments of an ever growing circle that is confined in a small space.

  • @thefractalistic3761
    @thefractalistic3761 Před 3 lety +7

    Welp, there's one of my questions answered, nice!

  • @URAYULI
    @URAYULI Před 3 lety

    If I ever make a video game, this'll be the loading icon.

  • @firelow
    @firelow Před 3 lety

    This is much better than an ellipse

  • @azurbtkl3901
    @azurbtkl3901 Před 3 lety +7

    Do your simulations require big computational effort to run? I'd like to code something like this for fun :)

    • @NilsBerglund
      @NilsBerglund  Před 3 lety +7

      This one did not require much time to run, only quite a lot of memory (about 300Mb). I'm still improving the code for this one, but you will find links to the code I used in some similar simulations on my channel, see descriptions of billiards in an ellipse.

    • @azurbtkl3901
      @azurbtkl3901 Před 3 lety +1

      @@NilsBerglund thank you!

  • @SelimovYunus
    @SelimovYunus Před 3 lety +1

    It is amazing!

  • @snowfloofcathug
    @snowfloofcathug Před 3 lety

    Älskar hur bra den här blev

  • @gigachad896
    @gigachad896 Před 3 lety +2

    Beautiful

  • @Janex-06
    @Janex-06 Před 3 lety +1

    ITS ADDICTING

  • @qwerty-qw2zc
    @qwerty-qw2zc Před 3 lety +1

    ASMR for my eyes
    I love it!

  • @felynecomrade
    @felynecomrade Před 3 lety +3

    I'd like to see this video in reverse.

  • @nataliehogue1276
    @nataliehogue1276 Před 3 lety

    im always super enamored with these videos. I make electronic music and would love to make some generative stuff to accompany these visuals. I see you post some of your stuff on github but what program/IDE are you using?

    • @NilsBerglund
      @NilsBerglund  Před 3 lety

      That sounds interesting! Why don't you get in touch via the contact info on my homepage, see "About" on my channel. The videos are generated by C code, using OpenGL and ffmpeg to generate the movie.

  • @slaughterchainsaw
    @slaughterchainsaw Před 3 lety

    I love these videos

  • @CesarGamboa
    @CesarGamboa Před 3 lety

    These videos are so mesmerizing.
    Not sure how hard it would be to do, but for cases like this one it could be interesting to see what happens if instead of changing colors when refracting, the initial circle was made of a gradient(/rainbow wheel) so you could see where each part of the circle is
    For instance, in this case the lines/waves that are "most parallel" to the square edges would be the colors of the four cardinal points of the initial circle and lines with close slopes would likely have similar colors

    • @NilsBerglund
      @NilsBerglund  Před 3 lety +1

      That would not be hard to do, I can try sometime. A somewhat similar idea is used here: czcams.com/video/2NLtpcyuRO8/video.html

  • @MelvinDorkus
    @MelvinDorkus Před 3 lety

    Way more interesting than circling the square

  • @retrojac2894
    @retrojac2894 Před 3 lety

    Some real Super Paper Mario vibes from this.

  • @DourDervish
    @DourDervish Před 3 lety

    Ever notice how theres always at least 1 square in the middle at all times?
    Sometimes more overlapping but still its cool

  • @someoneunknown6553
    @someoneunknown6553 Před 3 lety

    Now we just need a hyperbolic simulation and our collection is complete! 😅

  • @avrilavigne21
    @avrilavigne21 Před 3 lety +1

    Sooo mesmerising!! Could you circle the square now?

  • @artegiannioti7976
    @artegiannioti7976 Před 3 lety

    Why isn't the video from like 2011 it gives off that energy

  • @eli0664
    @eli0664 Před 3 lety

    Teacher: the test isnt confusing
    the test:

  • @azazel2551
    @azazel2551 Před 3 lety

    finally, something with music

  • @jenniejudas3227
    @jenniejudas3227 Před 3 lety

    Square: What shape do you want to be, Circle?
    Circle: YES
    Square: I gotchu fam

  • @adityadhar1358
    @adityadhar1358 Před 3 lety +1

    I believe that, it will become a circle again after some time, Because Energy is constant of the system

  • @jbeanp1
    @jbeanp1 Před 3 lety +1

    Can you do this same thing but with an “infinite” plane of squares showing how the reflections are just an ever growing circle? Somewhat like Numberphiles video on the net of a dodecahedron but instead the net of an infinitely sided cube

    • @NilsBerglund
      @NilsBerglund  Před 3 lety +1

      That seems a good idea, yes, as it would explain that reflecting the wave is equivalent to reflecting the square on its boundaries without reflecting the wave...

  • @THESTOATKING
    @THESTOATKING Před 3 lety

    i wonder how it might look to write the of the area containing the center of the square bound by the innermost curves and their intersections as a function of time. it must be continuous, and there is some periodicity inherent. could the integral of that function can be figured in an interesting way? even the pattern of local maxima must be interesting.

    • @NilsBerglund
      @NilsBerglund  Před 3 lety

      I'm not sure, but there may be a connection with Weyl's law ( en.wikipedia.org/wiki/Weyl_law ) and higher-order corrections to it, which would describe the number of lattice points in the growing circle.

  • @PokeBallZSack
    @PokeBallZSack Před 3 lety

    What you’re calculator sees when you try to divide by 0

  • @DavidGillooly
    @DavidGillooly Před 2 lety

    I am interested in the center position where it seems at times there is a rapid succession of what looks like a series of circles. It seems to have more circles repeating as time goes on.Then again maybe I am getting hypnotized and seeing things that aren’t there. Any way that’s what I see. The circles in the center seem to always reaper only to replaced by expanding squares.

    • @NilsBerglund
      @NilsBerglund  Před 2 lety

      I don't know if this has been considered, but it has the feel of an arithmetic problem to me.

  • @Dalenthas
    @Dalenthas Před 3 lety

    I kept seeing asymmetrical movement, but of course that's just an optical illusion. Every frame maintains the initial four way radial symmetry it started with.

  • @max_garcia
    @max_garcia Před 3 lety

    A game would lag so hard with this but it would actually be a challenge to avoid all of those

  • @lordman5497
    @lordman5497 Před 3 lety

    This looks like the projection of a rotating higher-dimensional polytope

  • @DragonsDystopia
    @DragonsDystopia Před 3 lety

    I felt like I was going to have a stroke watching the ripples

  • @raptormind_8033
    @raptormind_8033 Před 3 lety

    How does it reflect off of the corners? Did you round them off ever so slightly so that there’d be a clear tangent line to work with? Or maybe just code in that the corner acts as though it has some specific tangent line when something bounces off of it?

    • @NilsBerglund
      @NilsBerglund  Před 3 lety

      You can show that there is a well-defined limit for the reflection of particles hitting the corner closer and closer on either side. These particles simply make half a turn. However I'm still working on eliminating a glitch in the code causing a particle to escape the square now and then...

  • @FrankleAnkles
    @FrankleAnkles Před 3 lety

    so this was how earthbound battle backgrounds were made

  • @lampboy926
    @lampboy926 Před 3 lety

    Me : I hava an important exam tomorrow so I have to study from now
    CZcams : wanna see a circle turning in to square?
    Me :

  • @Hervusky
    @Hervusky Před 3 lety +1

    TRES BELLE ANIMATION DE LIGNES MULTIPLES MULTICOLORES
    ET TRES BELLE MUSIQUE AUSSI......

  • @BubbleBFDI
    @BubbleBFDI Před 3 lety

    Alternate title: how to make a kaleidoscope

  • @melody3741
    @melody3741 Před 3 lety

    These videos are cool but you choose really awesome music for these videos

  • @sirdouglas.2870
    @sirdouglas.2870 Před 3 lety

    How did you do this demonstration? What programs did you use?

    • @NilsBerglund
      @NilsBerglund  Před 3 lety

      It's a C code, using OpenGL. I have not yet published the code for this one, but you will find code in the description of some other videos on this channel.

  • @robertneely9766
    @robertneely9766 Před 3 lety

    The ending is what a tesseract looks like

  • @mcqueen10.
    @mcqueen10. Před 3 lety

    I would like to see this in reverse. Circling the square.

  • @Random_Nobody_Official

    This gets crazy

  • @colettef-yt
    @colettef-yt Před 3 lety

    This is cool. A SQUARED CIRCLE

  • @oxnvat
    @oxnvat Před 3 lety +1

    Ok now circle the square

  • @pav28amur
    @pav28amur Před 3 lety

    Hi! Awesome =) How many particles are in this simulation?

    • @NilsBerglund
      @NilsBerglund  Před 3 lety +1

      Thanks! This one uses 10,000 particles.

    • @pav28amur
      @pav28amur Před 3 lety

      @@NilsBerglund Thanks for answering =) Have a good time!

  • @infinitewy
    @infinitewy Před 3 lety

    minecraft is actually a game of circles. this video proves it

  • @Alovatololo
    @Alovatololo Před 3 lety +1

    These things are so trippy. Can you do one with a black background and white color for the border.

    • @Some.username.idk.0
      @Some.username.idk.0 Před 3 lety

      Even more trippy at 2x speed

    • @aura_flower3385
      @aura_flower3385 Před 3 lety

      @@Some.username.idk.0, that’s what I’m doing lol

    • @NilsBerglund
      @NilsBerglund  Před 3 lety +3

      That's actually easy to do. I can try it on one of the next videos, thanks!

  • @vyctor661
    @vyctor661 Před 3 lety

    If you think about it, the radius of the circle continues to expand, and while this happens the circle stays contained in the square, and the bigger the radius of a circle the flatter a portion of the circumference appears to be, which is what's happening here.

  • @logicbuilder1204
    @logicbuilder1204 Před 3 lety

    Hands in the air,
    Presidents, prime ministers
    They said that we didn't care
    But that isn't fair
    Hands in the air,
    Presidents, prime ministers
    They said that we didn't care
    But we're the square in the circle.

  • @clouck59
    @clouck59 Před 3 lety

    I love your videos, but I prefer much more the ones where chaos eventually emerges.
    Maybe do one with more random shapes than square and ellipses, someday :)

  • @frimi8593
    @frimi8593 Před 3 lety

    As a joke video, you should do one that starts in the middle of a parabola and just straightens out and goes offscreen as nothing else happens for the remaining several minutes of the video

  • @endarus6053
    @endarus6053 Před 3 lety

    the amount of lines increases every time it hits the corners.

  • @alexdg24
    @alexdg24 Před 3 lety +1

    Epic

  • @Ryytikki
    @Ryytikki Před 3 lety

    so what time did the rest of you start disassociating?

  • @latioshunter
    @latioshunter Před 3 lety

    So thats what people mean when they say "blink and you'll miss it"

  • @minleyfox5231
    @minleyfox5231 Před 3 lety

    So what does it basically solve? Just curious

  • @jonathanh.110
    @jonathanh.110 Před 3 lety

    Now we only have to find a way to do that with ruler and circle.

  • @technoneko8108
    @technoneko8108 Před 3 lety +1

    Love seeing the event horizon effect here, as the circle get bigger it only appears to straighten out

  • @K4i_x
    @K4i_x Před 3 lety

    Wow cool

  • @nicodobler5986
    @nicodobler5986 Před 3 lety

    Interestingly all of those lines glued together would at every moment form an in size increasing circle.

  • @thatguywiththetripod8577
    @thatguywiththetripod8577 Před 3 lety +1

    If you pay attention towards the end, you'll see we've come full circle. ;)

  • @xYottabyte
    @xYottabyte Před 3 lety

    tv screen saver felt like this

  • @jnr2349
    @jnr2349 Před 3 lety

    Is this the same as if you had an infinite grid and superimposed all the grid-squares which have a piece of the circle in it as it grows?

    • @NilsBerglund
      @NilsBerglund  Před 3 lety

      Yes, except that some of the grid-squares are flipped upside-down or left-right.

  • @kirbgaming8192
    @kirbgaming8192 Před 3 lety

    Circle: **hits wall**
    Me: I don’t get it this isn’t really working
    Circle: **hits wall again**
    Me: ok Einstein calm down