CodingTrain / CodingTrain/Suggestion-Box

Root-Finding Fractals

Open
#1,839 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
570
Forks
85
PR merge metrics
No merged PRs in 30d

Description

Yes, two others have already suggested Newton Fractals #1696 and #1626 while also referring to 3b1b's video on the subject [https://www.3blue1brown.com/lessons/newtons-fractal](https://www.3blue1brown.com/lessons/newtons-fractal), but there is a bigger picture that folks (including Grant) are missing. Newton's method $x_{n+1}=x_n\frac{f(x_n)}{f'(x_n)}$ is not the only method for finding roots nor is it the only way to make these kinds of fractals.

With one change you can go from:

![https://raw.githubusercontent.com/osveliz/numerical-veliz/refs/heads/master/photos/NewtonFractal/zcube1.png](https://raw.githubusercontent.com/osveliz/numerical-veliz/refs/heads/master/photos/NewtonFractal/zcube1.png)

to

![https://raw.githubusercontent.com/osveliz/numerical-veliz/refs/heads/master/photos/JarrattSPIFractal/z4o4-z.png](https://raw.githubusercontent.com/osveliz/numerical-veliz/refs/heads/master/photos/JarrattSPIFractal/z4o4-z.png)

to

![https://raw.githubusercontent.com/osveliz/numerical-veliz/refs/heads/master/photos/HalleyFractal/z3-1halfhalfi.png](https://raw.githubusercontent.com/osveliz/numerical-veliz/refs/heads/master/photos/HalleyFractal/z3-1halfhalfi.png)

to

![https://raw.githubusercontent.com/osveliz/numerical-veliz/refs/heads/master/photos/JenkinsTraubFractal/z3-1.png](https://raw.githubusercontent.com/osveliz/numerical-veliz/refs/heads/master/photos/JenkinsTraubFractal/z3-1.png)

All by making minor changes to the iteration function like Halley's Method, Householder's Method, or Jenkins-Traub. These were all essentially different methods of solving $z^3-1=0$.

If you change the input function to something like $z^8-15z^4-16=0$ and include a scaling factor you get:

![https://raw.githubusercontent.com/osveliz/numerical-veliz/refs/heads/master/photos/NewtonFractal/z8%2B15z4-16halfhalfi.png](https://raw.githubusercontent.com/osveliz/numerical-veliz/refs/heads/master/photos/NewtonFractal/z8%2B15z4-16halfhalfi.png)

I was just coloring on if it converged or not, but you can also color based on which root it finds such as:

![https://raw.githubusercontent.com/osveliz/numerical-veliz/refs/heads/master/photos/NewtonFractal/z8/z8.png](https://raw.githubusercontent.com/osveliz/numerical-veliz/refs/heads/master/photos/NewtonFractal/z8/z8.png)

The code that generated these images is available via [https://github.com/osveliz/numerical-veliz](https://github.com/osveliz/numerical-veliz) shared by the author (me) and they are very small programs. I have a Numerical Analysis [YouTube channel](https://www.youtube.com/OscarVeliz) with 12k subscribers and I would appreciate a shout-out if you decide to use this. I made my original video on [Newton Fractals](https://youtu.be/MWD2A0Vg2V0), 3 years before 3b1b's version, but everyone watches that one now. If you would like to collaborate on something, I would be glad to work with you.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.