8.2: Fractal Recursion - The Nature of Code

  Рет қаралды 52,073

The Coding Train

The Coding Train

Күн бұрын

This video looks at how to write functions in Processing that call themselves (recursion) for the purpose of drawing fractals.
(If I reference a link or project and it's not included in this description, please let me know!)
Read along: natureofcode.co...
Cantor Set: en.wikipedia.or...
Serpinski Triangle: en.wikipedia.or...
github.com/shi...
Help us caption & translate this video!
amara.org/v/Qbv7/
📄 Code of Conduct: github.com/Cod...

Пікірлер: 53
@user-ri7fo6tp5e
@user-ri7fo6tp5e 5 жыл бұрын
My favorite thing about your videos is you teach things that are interesting to you, and by extension they have fascinated me. Great work and I love your book.
@developercorey1082
@developercorey1082 4 жыл бұрын
This rabbit hole leads to some very in-depth knowledge and understanding. It's always nice to see how you portray your information. Keep up the awesome work. I look forward to seeing your future uploads.
@dukkhan1288
@dukkhan1288 8 жыл бұрын
"You can stop the video now because you've probably done enough." Yeah right, because anyone who's made it that far isn't absolutely fascinated with your lessons.
@jasonedward
@jasonedward 4 жыл бұрын
With this video you have just unlocked the key to infinity. Thank you for sharing this
@DiamanteKlopman
@DiamanteKlopman 9 жыл бұрын
This videos are great, I wish they soon get the amount of views something this good deserve.
@collectionchannel1624
@collectionchannel1624 Жыл бұрын
I need to learn more about this circles and the numbers they hide and the secret behind them because they are important in trading
@KarlPhillipBuhr
@KarlPhillipBuhr 6 жыл бұрын
+1 for StackOverflowError
@nishkaarora6343
@nishkaarora6343 8 жыл бұрын
Hey! Do you think you could do a series on D3? I really like the way you teach and can't really find any good youtubers for D3. Thanks!
@TheCodingTrain
@TheCodingTrain 8 жыл бұрын
I will consider it, yes. But it will probably be a while before I have time to get to a new JS framework.
@markoichise-briscech4654
@markoichise-briscech4654 8 жыл бұрын
Many thanks for the vids Dan, I appreciate them a lot :D
@veerrajuyeleti8541
@veerrajuyeleti8541 7 жыл бұрын
sir can you do videos on dynamic programming in real life applications please
@amitthakkar22288
@amitthakkar22288 8 жыл бұрын
this is wrong, you make coding sound like fun. :D .
@TurntBucket
@TurntBucket 8 жыл бұрын
WARNING!!! Do not google monster curve. NSFW
@hammer158
@hammer158 8 жыл бұрын
Seriously!!DONT!!!!!
@sujandutta8981
@sujandutta8981 6 жыл бұрын
you should have searched Devils' curve instead! :p
@MPAYNE-ij1jh
@MPAYNE-ij1jh 4 жыл бұрын
Hi, is there a way to create a fractal zoom from text? I'm hoping to do this for my Uni project! I hope this made sense
@realcygnus
@realcygnus 8 жыл бұрын
loving this channel !......so neither the processing or the p5 IDEs have any form of an intellisense(I think thats what M$ calls theirs) ? to auto-list available items etc...or a type prediction or way to find other references of highlighted area etc.....I could swear i seen it active in one of you vids.......was it a different IDE....what was it ......& was it for pde or p5 or both ?.... does anyone know?
@olfmombach260
@olfmombach260 7 жыл бұрын
realcygnus Go to settings and enable code suggestions. To trigger it press Ctrl+Space.
@latifguliyev
@latifguliyev 8 жыл бұрын
Thanks for great tutorial, are there any IDE for Fractals or any apps that can use?
@TheCodingTrain
@TheCodingTrain 8 жыл бұрын
+Latif Guliyev These tutorials and the example code are designed for use with processing.org, check it out!
@benjaminphilippe2810
@benjaminphilippe2810 7 жыл бұрын
www.dangries.com/Flash/FractalMakerExp/FractalMaker_exp.html
@nagesh007
@nagesh007 2 жыл бұрын
Amazing
@randmorf
@randmorf 4 жыл бұрын
Has anyone tried this with Python Turtle Graphics? It seems like the circle() method is different than in Processing. In Processing, it seems each circle is drawn relative to the center of the circle, while with Python Turtle Graphics, each circle is drawn relative to the turtle which is on the circumference of the circle. I was able to correct for this with a recursive program that can draw a series of concentric circles, but when I put in off-sets so each recursive circle is drawn further out along the x-a is, my correction code pulls it back so it’s drawn relative to coordinates 0,0 in the middle of the screen. I suppose it would be easier if I switch to Processing, but everything else I do these days is with Python.
@randmorf
@randmorf 4 жыл бұрын
I figure it out in Python Turtle Graphics... # Python Turtle Graphics - Recursive Circles v3 ==> "Sierpinski Triangle" # # Inspiration: "The Nature of Code" by Daniel Shiffman # Chapter 8.2 - Recursion # # URL: natureofcode.com/book/chapter-8-fractals/ # import turtle def drawCircle(x, y, radius, correction): # Re-center the circle... t.penup() t.setposition(x,y-radius) t.pendown() # Draw circle.. t.circle(radius) # Call self again (recursion) if radius > 2: #t.color("red") drawCircle(x + radius, y, radius/2, increment) #t.color("green") drawCircle(x - radius, y, radius/2, increment) #t.color("blue") drawCircle(x, y - radius, radius/2, increment) #t.color("magenta") #drawCircle(x, y + radius, radius/2, increment) # Main Code: scn = turtle.Screen() # Request a screen object, call it 'scn' scn.bgcolor("skyblue") # Set screen background color scn.title("Recursive Circles 3") t = turtle.Turtle() # Create the turtle object, call it "t". t.speed(0) t.hideturtle() t.pensize(1) radius = 150 increment = 25 t.color("black") drawCircle(0,0,radius,increment) print("Done.") turtle.done() # EOF
@AboutDisneyFriendsGa
@AboutDisneyFriendsGa 7 жыл бұрын
Have you ever used grasshopper?
@fruityang9681
@fruityang9681 8 жыл бұрын
You're amazing :')
@andrawina6571
@andrawina6571 6 жыл бұрын
How to create video like this?
@franksimon8375
@franksimon8375 2 жыл бұрын
I'm doing a 5d to 3d nature model thing
@1oglop1
@1oglop1 9 жыл бұрын
how could you learn all this?
@TheCodingTrain
@TheCodingTrain 9 жыл бұрын
+oglop For additional references check out natureofcode.com. Hope this helps!
@1oglop1
@1oglop1 9 жыл бұрын
+Daniel Shiffman I meant that my brain is not capable to remember it all. Maybe I'll try to record some videos to, to help me remember but, thanks I will try
@TheCodingTrain
@TheCodingTrain 9 жыл бұрын
+oglop oh I see!
@CuongNguyen250690
@CuongNguyen250690 7 жыл бұрын
Understand. Do not remember. As you see even Daniel Shiffman usually forget the mini step, but eventually he gets back on track because of deduction.
@AryehAmitz
@AryehAmitz 9 жыл бұрын
Ever use Incendia EX?
@TheCodingTrain
@TheCodingTrain 9 жыл бұрын
+Indigo Veilplume i have not, but will check it out.
@18ipmg
@18ipmg 2 жыл бұрын
Lol going deep with this vid.
@DlcEnergy
@DlcEnergy 8 жыл бұрын
12:09 The matrix is lagging again...
@franksimon8375
@franksimon8375 2 жыл бұрын
Code plz p5. I'M LAZY!!!!
@TheLiquidAtom
@TheLiquidAtom 7 жыл бұрын
holy shit illuminati
@crimsomnia1415
@crimsomnia1415 2 жыл бұрын
Now program a recursive genome of a living creature (or a virus) xD
@ronaldcabrera675
@ronaldcabrera675 5 жыл бұрын
What programming language is this? I'm just getting an error when I type in DevTools...
@randmorf
@randmorf 4 жыл бұрын
A language called “Processing”
@Colonies_Dev
@Colonies_Dev 4 жыл бұрын
looks more like C bruh
@Colonies_Dev
@Colonies_Dev 4 жыл бұрын
im not even sure if this is C or java ;-;
6 жыл бұрын
Please sub this video to english
@MemeCult
@MemeCult 7 жыл бұрын
This person isa nerDDDDDDDD
Coding Challenge #14: Fractal Trees - Recursive
15:53
The Coding Train
Рет қаралды 893 М.
Random Emoji Beatbox Challenge #beatbox #tiktok
00:47
BeatboxJCOP
Рет қаралды 66 МЛН
小丑揭穿坏人的阴谋 #小丑 #天使 #shorts
00:35
好人小丑
Рет қаралды 54 МЛН
Каха и лужа  #непосредственнокаха
00:15
бабл ти гель для душа // Eva mash
01:00
EVA mash
Рет қаралды 9 МЛН
8.5: L-Systems - The Nature of Code
21:11
The Coding Train
Рет қаралды 70 М.
CONCURRENCY IS NOT WHAT YOU THINK
16:59
Core Dumped
Рет қаралды 114 М.
5 Simple Steps for Solving Any Recursive Problem
21:03
Reducible
Рет қаралды 1,2 МЛН
6.4: Steering Behaviors: Flow FIeld Following - The Nature of Code
13:45
The Coding Train
Рет қаралды 33 М.
6.2: Steering Behaviors: Seek - The Nature of Code
12:38
The Coding Train
Рет қаралды 49 М.
Creating fractals using recursion
13:10
Programming Chaos
Рет қаралды 3,4 М.
ARRAYLIST VS LINKEDLIST
21:20
Core Dumped
Рет қаралды 75 М.
Fractals in Nature | nature geometry  | edu-archs
0:19
Edu-Archs
Рет қаралды 15 М.
4.2: ArrayLists in Processing - The Nature of Code
13:51
The Coding Train
Рет қаралды 77 М.
Random Emoji Beatbox Challenge #beatbox #tiktok
00:47
BeatboxJCOP
Рет қаралды 66 МЛН