Coding Challenge #21: Mandelbrot Set with p5.js

SdĂ­let
VloĆŸit
  • čas pƙidĂĄn 5. 08. 2024
  • In this coding challenge, I program from scratch the Mandelbrot set with p5.js Code: thecodingtrain.com/challenges...
    đŸ•č p5.js Web Editor Sketch: editor.p5js.org/codingtrain/s...
    đŸŽ„ Previous video: ‱ Coding Challenge #20: ...
    đŸŽ„ Next video: ‱ Coding Challenge #22: ...
    đŸŽ„ All videos: ‱ Coding Challenges
    References:
    🗄 Wikipedia on Mandelbrot Set: en.wikipedia.org/wiki/Mandelb...
    đŸ’Ÿ Mandelbrot Set Explorer: meiamso.me/old/mandelbrot/man...
    Related Coding Challenges:
    🚂 #22 Julia Set in Processing: ‱ Coding Challenge #22: ...
    🚂 #140 Leibniz Formula for Pi: ‱ Coding Challenge #140:...
    🚂 #168 The Mandelbulb: ‱ Coding Challenge 168: ...
    Timestamps:
    0:00 Introducing today's coding challenge: the Mandelbrot set
    1:22 What is a complex number?
    6:06 Multiplying two complex numbers
    7:51 The Mandelbrot set is all of the complex numbers that stay bounded
    8:40 The initial sketch sets every pixel to gray
    12:00 Calculate the real and complex components for the next generation
    13:03 What does it mean to be bounded?
    14:58 Set the brightness based on number of iterations
    16:46 Store the original values of a and b
    20:05 Set the brightness by mapping to maxIterations
    21:50 Add sliders to add ability to zoom in on the Mandelbrot set
    24:58 Conclusion and suggestions for variations
    Editing by Mathieu Blanchette
    Animations by Jason Heglund
    Music from Epidemic Sound
    🚂 Website: thecodingtrain.com/
    đŸ‘Ÿ Share Your Creation! thecodingtrain.com/guides/pas...
    đŸš© Suggest Topics: github.com/CodingTrain/Sugges...
    💡 GitHub: github.com/CodingTrain
    💬 Discord: / discord
    💖 Membership: czcams.com/users/thecodingtrainjoin
    🛒 Store: standard.tv/codingtrain
    đŸ–‹ïž Twitter: / thecodingtrain
    📾 Instagram: / the.coding.train
    đŸŽ„ Coding Challenges: ‱ Coding Challenges
    đŸŽ„ Intro to Programming: ‱ Start learning here!
    🔗 p5.js: p5js.org
    🔗 p5.js Web Editor: editor.p5js.org/
    🔗 Processing: processing.org
    📄 Code of Conduct: github.com/CodingTrain/Code-o...
    This description was auto-generated. If you see a problem, please open an issue: github.com/CodingTrain/thecod...
    #mandelbrot #fractal #complexnumber #imaginarynumber #p5js #javascript

Komentáƙe • 491

  • @lclane5256
    @lclane5256 Pƙed 4 lety +122

    I love this guy's positive energy. It just screams: "I consider espresso a food group...no, the WHOLE food pyramid!" And...I approve.

  • @baptistebauer99
    @baptistebauer99 Pƙed 6 lety +393

    Dude this is amazing... let me list everything that happened right there:
    -you were doing a live with people interacting with you by chat, but sill made a perfectly senseful podcast
    -you explained very well and in a small amount of time what the problem is like, defined the complex numbers according to the problem and explained exactly what needed to be explained.
    -you coded the Mandelbrot set. Just this.
    -without taking any notes of your code, you still had a perfect knowledge of your code.
    -you made very clear what each part of your code was doing.
    In a livestream, explaining and coding the mandelbrot set with no taking notes and be able to understand and explain everything clearly. And then post this video as if it was not a live.
    This _is_ amazing.

    • @TheCodingTrain
      @TheCodingTrain  Pƙed 6 lety +49

      thank you!

    • @dsblocks
      @dsblocks Pƙed 5 lety +42

      @@TheCodingTrain you also told the haters to go outside and play frisbee.

    • @antares-the-one
      @antares-the-one Pƙed 5 lety +3

      this is called at least 160iq with very good memory. Usual people are unable to learn such skill even in 200 years, it is impossible for today. I dont know what that dude doing on youtube, while he clearly could work for google ai programs and earn millions of doll hairs without eye blink. He could start his own company and do even more. Instead he spend his time doing grate but useless videos

    • @mikael1891
      @mikael1891 Pƙed 4 lety +19

      @@antares-the-one Woah dude. Woah woah woah my inferior 69iq cannot comprehend what you just said. Okay, after about a month of studying your text I finally understood what you meant. I have took another month to come up with a response. No, people can learn to do this kind of stuff, as did I after watching this video and thoroughly examining the method that is used to create this fractal. It isn't as if he came up with the idea of this fractal by himself.

    • @lubomirpacheliev363
      @lubomirpacheliev363 Pƙed 4 lety +10

      @@antares-the-one I mean yeah he's wicked smart and the Bob Ross of programming but it doesn't take a genius to become this fluent in coding. It takes discipline and dedication to slam your head into a wall enough times.

  • @dtrinitypersonal
    @dtrinitypersonal Pƙed 6 lety +605

    What does the B stand for in Benoit B. Mandelbrot?
    Benoit B. Mandelbrot

    • @drachengard
      @drachengard Pƙed 6 lety +33

      That's recursion for you.

    • @LudwigvanBeethoven2
      @LudwigvanBeethoven2 Pƙed 6 lety +44

      My name is
      Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit Benoit
      "Unhandled Exception was thrown"

    • @zashtozaboga
      @zashtozaboga Pƙed 6 lety +4

      Benoit *B* Mandelbrot

    • @Maxim.Borodin
      @Maxim.Borodin Pƙed 5 lety +2

      It's a joke he himself thought out

    • @taureon_
      @taureon_ Pƙed 5 lety +5

      đŸ…±ïženoit đŸ…±ïž. MandelđŸ…±ïžrot

  • @nielsgroeneveld8
    @nielsgroeneveld8 Pƙed 5 lety +144

    I really love how you still scroll through comments of a 2 year old video and 'heart' comments you like.
    I love your passion and dedication to educating and helping people work on their future.
    I, and many people I've spoken with, find you to be a big genius. But I've come to realise your heart is even bigger.
    My appreciation of you is immense.

    • @mikael1891
      @mikael1891 Pƙed 4 lety +2

      I really love how you still scroll through comments of a 3 year old video and 'heart' comments you like.
      I love your passion and dedication to educating and helping people work on their future.
      I, and many people I've spoken with, find you to be a big genius. But I've come to realise your heart is even bigger.
      My appreciation of you is immense.
      pls give me heart i need some love

    • @penta5421
      @penta5421 Pƙed 4 lety +2

      @@mikael1891 RIP

    • @NStripleseven
      @NStripleseven Pƙed 4 lety +1

      MikaelK F in the chat

  • @HeadmostCantaloupe
    @HeadmostCantaloupe Pƙed 9 měsĂ­ci +6

    First, I was able to make a fractal tree with Dan's videos, and today 30th of October 2023, I made my own Mandelbrot Set with this video, two of the most beautiful and best things I've achieved while being a programmer. (FYI I'm in 6th grade so this idea of Complex numbers, Imaginary numbers and fractals is new to me and I've yet not learned it to their fullest potential.) Next I'm going to try to make a Julia set in p5.js, I'll notify you when I get there.

  • @denelson83
    @denelson83 Pƙed 7 lety +68

    abs(a + b) > 16 as your iteration break rule is one way to colour the points that aren't in the set, but if you want those smooth contours around the set, you might use the break rule sqrt(a*a + b*b) > 2 instead.

    • @yuvalgat4163
      @yuvalgat4163 Pƙed 7 lety +47

      You're correct, though this is extremely slow, using (a*a+b*b)>4 is much faster :3

    • @coins_png
      @coins_png Pƙed 3 lety +2

      Thank you ancient ones, I will put this knowledge to good use

  • @wheetcracker
    @wheetcracker Pƙed 5 lety +79

    12:45
    I too like to disguise my for loops as while loops

    • @blockcamp
      @blockcamp Pƙed 4 lety

      lol

    • @sushmadevi3652
      @sushmadevi3652 Pƙed 4 lety

      I do that..... A lot

    • @Hello-qg4yk
      @Hello-qg4yk Pƙed 3 lety +1

      I dont get why people use while.
      Int i = 0;
      While (condition)
      {
      code
      i++
      }
      IMO is worse than
      For(int i = 0; condition; i++)
      {
      Code
      }

  • @granumuse7847
    @granumuse7847 Pƙed 5 lety +3

    Man you are really great! I'm watching your video on p5 for 6 months and you still astonish me! You did it on my favourite part of mathematics, the Mandelbrot set! No words- Respect only!! Thank you! Keep gonna!!

  • @Samfineddie123
    @Samfineddie123 Pƙed 7 lety +22

    You're probably my favourite youtuber now Dan. I love your energy, enthusiasm, and excitement. Keep up the great JS code challenges :)

    • @anzejuvan2165
      @anzejuvan2165 Pƙed 7 lety

      dude i just found this chanel. Feeling super happy.

  • @J_Abad
    @J_Abad Pƙed 7 lety +7

    Man, you rock! never thought someone could pour so much energy on complex numbers.
    Well, someone else besides Cauchy.

  • @martingrof1685
    @martingrof1685 Pƙed 7 lety +75

    Hey Daniel I really love your happy attitude, good work on your videos!

    • @TheCodingTrain
      @TheCodingTrain  Pƙed 7 lety +22

      Thank you for watching!

    • @rbvaet3438
      @rbvaet3438 Pƙed 7 lety +1

      this, it's like u can really tell you truly enjoy what you're doing

  • @Mr1flapjack1
    @Mr1flapjack1 Pƙed 5 lety +2

    i've spent so long trying to understand the mandelbrot set.
    i gave up
    then you explained it in 5 minutes
    AND IT FINALLY MAKES SENSE

  • @phucknaw2104
    @phucknaw2104 Pƙed 4 lety

    You are amazing man! Your understanding and passion for math and coding is astounding.

  • @kingdiamond5840
    @kingdiamond5840 Pƙed 7 lety +2

    You have single-handedly restored my faith in CZcams.

  • @Nucl34rManiac
    @Nucl34rManiac Pƙed 4 lety

    I always come to this channel to get my math/coding fix, and these videos are so fun to watch! I don’t have a programming background, but I am very eager to learn

  • @EduardoGR1004
    @EduardoGR1004 Pƙed 4 lety +29

    "If you don't (want to code Mandelbrot set), you can go outside and play frisbee"
    No I can't.

  • @Thelunamiah
    @Thelunamiah Pƙed 4 lety +1

    I love how excited he is about math. warms my heart.

  • @Game.UI.Design.Tutorials
    @Game.UI.Design.Tutorials Pƙed 5 lety +4

    If I had you as my teacher I'd achieve so much more. You inspire, you make difficult subjects understandable, you show how this is relevant and connects to each other. When I was in school, I spent so much time with teachers saying "you dont have the head to this..." yet I understand you and what you show here. Thank you and this channel! Keep the train going!!!
    Best wishes!

    • @huizylove
      @huizylove Pƙed 4 měsĂ­ci

      Hello how do you approach this material? What's your routine? I am new to programming and want to practice more. How many video do you do per month? And do you pause the video to try before watching or just watch then try? Thank you

  • @tundrummax6221
    @tundrummax6221 Pƙed 6 lety +12

    Right before you got your first Mandelbrot set, you had a Julia set!

  • @neilaryaofficial
    @neilaryaofficial Pƙed 6 měsĂ­ci

    You are just awesome, love your work!!

  • @darthpepe6761
    @darthpepe6761 Pƙed 4 lety

    these are so interesting to program. i programmed multiple julia sets in MATLAB. It was really cool how all of the plots turned out. great vid man.

  • @LiamPorterFilms
    @LiamPorterFilms Pƙed 6 lety

    So smart yet so humble! Great video

  • @LetMeDieLord
    @LetMeDieLord Pƙed 5 lety +27

    I didn't understand too much of this video - although i get the very basic idea. I still watched it all the way through. That speaks not only of my fascination with the topic, but also your refreshing way of presentation :) thanks.

    • @hareecionelson5875
      @hareecionelson5875 Pƙed 3 lety

      Numberphile do amazing Mandelbrot videos as well, I could watch fractal videos for hours

  • @bghnv123
    @bghnv123 Pƙed 7 lety +2

    I'm 2 mins into this video and I already love everything about this

  • @travispetit2410
    @travispetit2410 Pƙed 6 lety

    I want to program this myself. This video is extremely helpful. THANK YOU :)

  • @pabloescobar2089
    @pabloescobar2089 Pƙed 6 lety +2

    what a happy man!!!
    your smile is infectious :)

  • @prodbycitrus
    @prodbycitrus Pƙed 7 lety +23

    you would be the perfect teacher xD love all your vids, keep up the great work :)

  • @GameCasters
    @GameCasters Pƙed 6 lety

    thank you for explaining your material in detail. it helps us noobies so much!. please assume i failed math in HS and need to be explained in a watered down non jargon langauge. i really enjoy your enthusiasm and over all friendliness. it makes me feel you're not judging me and that makes me comfortable and inspires me to keep learning. i subscribed!

  • @leobrooks94
    @leobrooks94 Pƙed 4 lety

    I just found your channel. I'm going to love it here.

  • @OlafDoschke
    @OlafDoschke Pƙed 7 lety +2

    The coloring will become what you see and know from renderings, when you don't break iteration on abs(a+b)>16, but check a^2+b^2>N with N at least 2^2. That it also works with abs(a+b)>16 just shows the criterion for divergence vs convergence can be tested in a variety of ways.

  • @hexagonist23
    @hexagonist23 Pƙed 4 lety

    It's mindblowing. This shape just. comes from nowhere. It's built into reality.

  • @mibdev
    @mibdev Pƙed 7 lety +3

    Ooo, I've always wondered what kind of algorithm you'd have to use to make these.
    Very interesting!

  • @ZEROgring0
    @ZEROgring0 Pƙed 7 lety

    Nice, even if you are not here to follow along with the code, you really learn something new :D

  • @lemonlordminecraft
    @lemonlordminecraft Pƙed 6 lety +1

    I'm so glad I was taught the basics of this in Grade 11 otherwise I would not have been able to understand the first part.

  • @leberkassemmel
    @leberkassemmel Pƙed 7 lety

    You explained that better than my teacher! Good Job! Now I understand it!

  • @EatMyYeeties
    @EatMyYeeties Pƙed 6 lety +2

    The imaginary number is actually a misnomer. It very much is a real number! It just doesn't fall anywhere on the number line for real numbers. It is its own branch, its own axis even! Imaginary came from the fact that the original mathematicians that were exploring this number didn't believe that it was a number at all due to it not being a number we can accurately point to on a number line. The reason, as I mentioned earlier, is because it resides on its own number line! It's pretty awesome! The mandelbrot set is a graph of imaginary to real numbers. You mentioned this a bit, but I figured I'd elaborate! It's a beautiful mathematic formula!

    • @TheCodingTrain
      @TheCodingTrain  Pƙed 6 lety

      Thank you for this important clarification!

    • @Woo4Me
      @Woo4Me Pƙed 4 lety

      You can also just consider this as a 2d vector and replace the squaring of the complex number with the equivalent geometric transformation in 2d. In this case double angle and add vector. Imaginary numbers are discussed in most mandlebrot videos but it's a bit of a sidetrack imo. :)

  • @peterliljebladh
    @peterliljebladh Pƙed 5 lety

    Finally a video for dummies.
    Thank you.

  • @Me-ic3li
    @Me-ic3li Pƙed 7 lety +76

    Does he ever not have the wrong end of this pen?

  • @MrAlper778
    @MrAlper778 Pƙed 7 lety +17

    Going to play Frizbee now bb

  • @sinx2247
    @sinx2247 Pƙed 7 lety

    Thanks so much! I was able to make a cool looking mandelbrot set in python!

  • @AbubakerMahmoudshangab
    @AbubakerMahmoudshangab Pƙed 6 lety

    Awesome man thank you

  • @TesserId
    @TesserId Pƙed 2 lety +2

    Yeah, Dr. Keiger said it is by definition not outside the absolute value of 2, which is a circle. So, iterating between -2 and 2 is correct. Note that if you've ever zoom out of the Mandelbrot fractal far enough, it all falls within a circle, radius of 2.

  • @alexthelion98486
    @alexthelion98486 Pƙed rokem

    you are super cool man, this is beyond insane...

  • @lockercoin3693
    @lockercoin3693 Pƙed 7 lety +1

    dude i get how passionate you are, and fyi i just get into c++ but i subscribed your channel anyway :)
    great work on making this video and i hope that i can learn sthg useful from here :)
    good luck

    • @Shockszzbyyous
      @Shockszzbyyous Pƙed 7 lety

      He makes many concepts clear, so that you can use them in any programming language :)

  • @dexattech
    @dexattech Pƙed 4 lety

    I love this❀

  • @rafaxsworld
    @rafaxsworld Pƙed 7 lety

    i dont even know how to programm actually, but i really like this videos somehow, i like this channel, keep it up!

  • @rituchandra6325
    @rituchandra6325 Pƙed 5 lety +1

    Hey!! i really liked this explanation to the mandelbrot set and when i tried to learn more about it, i learnt about mandelbrot deep zooms and different coloring algorithms (smooth coloring and histograms which i did not understand) which are used but i could not find much online about these algorithms and how exactly they work... would you please consider making a series on these topics? I think that many other people would also like to learn how it all works!!

  • @BossBeneBaby
    @BossBeneBaby Pƙed 6 lety +1

    I've never seen a person talking about complexe numbers with such dedication XD

  • @connorclub6244
    @connorclub6244 Pƙed rokem

    i find it fascinating how simple operations can scale super fast. with just a 200x200 canvas and 100 iterations, thats 4 million operations every single frame.

  • @jamesgrimwood1285
    @jamesgrimwood1285 Pƙed 6 lety

    I teach computer science in a school... the beginning of this video where you explain the Mandelbrot set is making my brain hurt in a way that my own teaching must make my students' brains hurt :) It's a fun meta-learning experience for me.

  • @fariza-rafa
    @fariza-rafa Pƙed 2 lety

    I liked how you explained everything with your clumsy smile! I felt quite comfortable despite being a stupid. :3

  • @lonelydepressedperson9184

    Damn, you are so precise to point at literally nothing

  • @LEON..D
    @LEON..D Pƙed 6 lety

    this guy's a good dude

  • @firstmanpower4736
    @firstmanpower4736 Pƙed 5 lety +2

    Thanks for teaching me *:)))))*

  • @azyfloof
    @azyfloof Pƙed 7 lety

    Does the slider object have a mouse button down event or anything like that? Set the maxiterations to a low number like 100 when the slider is being adjusted, then when the mouse button is released, render again over the top with a much higher maxiterations

  • @shiprasonal3923
    @shiprasonal3923 Pƙed 3 lety

    When he says "Thanks for watching"
    I be like man thanks for this wonderful video ❀

  • @thedoubleap
    @thedoubleap Pƙed 5 lety +3

    dan, I do the same with variable names and when I come back to that code I couldn't understand it

  • @eemelilehtonen8628
    @eemelilehtonen8628 Pƙed 4 lety +1

    Amazing. I made one with C++ and OpenGL with your help.

  • @dhaniOliver
    @dhaniOliver Pƙed 7 lety +2

    good teacher..

  • @suponjubobu5536
    @suponjubobu5536 Pƙed 2 lety

    This helped me to realize a mistake I made while attempting the same thing: I was overwriting the old real component before calculating the new imaginary component.

  • @ashishkingdom
    @ashishkingdom Pƙed 6 lety

    Nice!

  • @cherylcooper1885
    @cherylcooper1885 Pƙed 7 lety

    The craziest happiest math man ever!

  • @jacobtichenor8172
    @jacobtichenor8172 Pƙed 6 lety

    Quality content

  • @chrome7fan
    @chrome7fan Pƙed 2 lety

    This guys energy is something we need in more elementary schools.

  • @ker-balkanrider
    @ker-balkanrider Pƙed 7 lety

    That circle cracked me up XD

  • @realcygnus
    @realcygnus Pƙed 7 lety

    superb

  • @daboss8590
    @daboss8590 Pƙed 5 lety

    Slider ideas:
    1. Label the sliders
    2. Replace or add a slifer that adjusts both equally.
    3. Slider for max itirations.
    4. Slider to change pixel size (mabye in increments of 25 - 50?)

  • @LesterShipMirOleg1992
    @LesterShipMirOleg1992 Pƙed 8 lety +8

    Cool!

  • @letgoletgo
    @letgoletgo Pƙed 3 lety

    loved the frisbee comment :D :D :D . Good vibes :D

  • @gustavoexel5569
    @gustavoexel5569 Pƙed 5 lety +3

    A more precise way in while n < 100: is to do while z < 2:

  • @vjastrix
    @vjastrix Pƙed 7 lety +5

    I have a feeling the mandelbrot set should generally be contained between -2 and 2!

  • @jevicci
    @jevicci Pƙed 4 lety

    Will your arbitrary values of 16 (your substitute for infinity) and 100 (max iterations) result in values being included in the set that really don't belong there? In other words, is it possible that some values for C result in values greater than 16 but do not, in fact, diverge and/or some values for C require more than 100 iterations to be shown to be divergent?

  • @Okwach_Kich
    @Okwach_Kich Pƙed 2 lety

    Complex numbers are expressed in the form a +bi where a is the real component and b is the coefficient of the complex number i.

  • @bored_person
    @bored_person Pƙed 5 lety +2

    I already figured out how to do this myself, but I thought it might be interesting to see how you did it and how you did it differently from me.

  • @physicslover9912
    @physicslover9912 Pƙed 2 lety

    drawing in the 2 nested pixcel iteration loop is very slow. is there a fast process??
    please tell me 🙏🙏🙏🙏 I'm stuck

  • @anassboufrioua5423
    @anassboufrioua5423 Pƙed 7 lety

    if only i had a good computer you're awesome

  • @Marcox385
    @Marcox385 Pƙed 4 lety

    I keep revisiting this challenge every once in a while until I understand it completely. This time I have a question, at 22:42, when the *b* variable its mapped with the slider values why does it says width instead of height and still works as intended? (At line 23, after the copy-paste)

  • @samuelsm6853
    @samuelsm6853 Pƙed 7 lety

    Awesome video, I learned a lot form this and I was able to create a Java version of this mandelbrot set. But I have one question, how could I make the set moves and zoom in a specific location of the set?

  • @DoktorSchaedel
    @DoktorSchaedel Pƙed 4 lety +6

    Mandelbrotset: *exists
    This dude: it's programming time

  • @kevnar
    @kevnar Pƙed 2 lety

    It's videos like these that make me thingk Daniel Shiffman was a mad scientist in a past life. I mean, who else gets so excited about insanity?

  • @Yoplat
    @Yoplat Pƙed 6 lety

    can someone explain how he colors every pixels? I I'm trying to replicate this program in processing but I can't find a way to set the brightness of each pixel

  • @charlesufpa
    @charlesufpa Pƙed 3 lety

    very good

  • @ColeslawProd
    @ColeslawProd Pƙed 7 lety +9

    I think i might have a crush on this guy he's so fun to listen to AA

    • @TheMairex
      @TheMairex Pƙed 7 lety +1

      Nathaniel Cole Alexander Sometimes I fantasize dating Daniel...
      But that's just me

    • @ColeslawProd
      @ColeslawProd Pƙed 7 lety +1

      TheMairex aww lol~

  • @Micha1996
    @Micha1996 Pƙed 5 lety

    When taking square roots you get both positive and negative. I.e sqrt(-1) = + i or - i.
    Nice video by the way.

  • @toadfrommariokart64
    @toadfrommariokart64 Pƙed 7 lety

    shouldn't you raise the zoom value to the power of the slider value, so it doesn't appear to zoom quicker the farther you zoom in? my math might be backwards, but i think you can do something like that.

  • @johnrokosky
    @johnrokosky Pƙed 4 lety

    I cannot tell you how many maths videos I have watched. Alot. This was incredible. Thank you. Not only did you explain the math you also explained how to CODE IT. Can I tag other math people in this? how?

  • @kinfoomaster
    @kinfoomaster Pƙed 7 lety +163

    Can you please be me math teacher

    • @cmarkme
      @cmarkme Pƙed 6 lety +3

      He's mine!!!!

    • @stephenmwyatt2
      @stephenmwyatt2 Pƙed 6 lety +19

      you need the be English teacher

    • @brolee5831
      @brolee5831 Pƙed 6 lety +5

      No, he can't be you math teacher

    • @matheusd.rodrigues429
      @matheusd.rodrigues429 Pƙed 6 lety +20

      "me math teacher" is really commom in Colloquial British English, actually, you people need yo understand that English has hundreds of variations, just because you don't speak like that, doesn't mean he's wrong

    • @HunterLMelton
      @HunterLMelton Pƙed 6 lety

      English my dude

  • @balkanbully
    @balkanbully Pƙed 7 lety +3

    Put simply, a mandelbrot set is pretty much a closed shape with an infinitely long side. You can zoom in forever on one of the sides

    • @davishall
      @davishall Pƙed 7 lety +7

      Repodudeify That's any fractal. The Mandelbrot Set refers to one specific fractal.

    • @tennicktenstyl
      @tennicktenstyl Pƙed 7 lety

      nope.

  • @andydabin
    @andydabin Pƙed 7 lety +183

    Arrg!! Imaginary numbers are not non-existant!! They are just as real as negative numbers are!!

    • @oumoumad
      @oumoumad Pƙed 7 lety +25

      or as imaginary as negative numbers ! :D

    • @andydabin
      @andydabin Pƙed 7 lety +12

      mohamed oumoumad or as imaginary as numbers themselves :)

    • @oumoumad
      @oumoumad Pƙed 7 lety +11

      Exactly ! everything is imaginary, but somethings are more imaginary than others XD.

    • @amo6139
      @amo6139 Pƙed 7 lety +27

      #complexlivesmatter

    • @2001ivar2001
      @2001ivar2001 Pƙed 7 lety +10

      Hidan In math it is useless to talk about numbers "existing". The positive whole numbers where made to count stuff, the negative numbers made to keep track of debt and the complex numbers to solve other problems, such as factoring polynomials.

  • @sethdaetwiler3893
    @sethdaetwiler3893 Pƙed 7 lety

    Im working in processing and the starter code (traversal fro grey scale) gives me and index out of bounds

  • @andrearavano9753
    @andrearavano9753 Pƙed 8 lety +3

    Thanks for your effort to spreading education!!
    p.s. Quaternions would be a great topic to cover ^^

    • @TheCodingTrain
      @TheCodingTrain  Pƙed 8 lety

      love jonathan coulton!

    • @andrearavano9753
      @andrearavano9753 Pƙed 8 lety

      ... for "thing a week" i suppose. well, you're mastering this kind of mentality!! keep it up! (i will support you, startin to buy your book!)

  • @St0n3dCold
    @St0n3dCold Pƙed 3 lety

    I understand the math implementation part but didn't get what was those 5 lines of code at the beginning, can someone explain please? I don't know much about p5.

  • @fruitchewx127
    @fruitchewx127 Pƙed 3 lety

    What do you reckon numbers divided by 0 are multiples of i

  • @3van660
    @3van660 Pƙed 5 lety

    Could you explain in simple terms what you did to make the colouring system smooth? I'm a little bit stupid

  • @epiepe8190
    @epiepe8190 Pƙed 5 lety

    Isn‘t a way easier to do it with geogebra? Or is Geogebranot so good for things like this?

  • @Dude-kd3ey
    @Dude-kd3ey Pƙed 7 lety +2

    I watched Mr robot._. And now I can't stop watching programming/coding videos! Fml

  • @baphnie
    @baphnie Pƙed 4 lety

    If I run your code up to 9:00, I get ArrayIndexOutOfBoundsException: 10000...
    I'm in Processing 3.5.4, coding this in java (not js). Is that the issue? They seem so similar. Has anyone else encountered this, or can explain why it didn't happen in the video?

  • @mathias1147
    @mathias1147 Pƙed 7 lety

    I have no clue what your talking about at all but i find the whole video interesting even tho i dident understand a thing. This is a reacquiring feeling i get for all you videos I suck at coding but this your videos are interesting somehow.

  • @learningmathwithdavidb.9224
    @learningmathwithdavidb.9224 Pƙed 3 lety +1

    Sorry if this was pointed out already, but I believe there is a mistake at 10:15. When we are mapping the y-coordinate, 0 is at the top and "height" is at the bottom, so 0 should map to 2 and height should map to -2. Therefore I think the line should read "var b = map(y, 0, height, 2, -2);". Now, in the case of the Mandelbrot set it doesn't matter because it is symmetric across the x-axis, but if you try it with a different function the graph will be upside-down. Am I correct or did I misunderstand something? Very helpful video overall.

  • @ericraziel
    @ericraziel Pƙed 7 lety

    do you have a switch for your cameras? hahaha by the way love your way to explain math. GREAT work!