Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Secant Fractals: Root-Finding in the Complex Plane

Overview

A Java implementation of the Secant method for finding roots of complex polynomials, extended to visualise Newton/Secant fractals — striking images that emerge from colouring each point in the complex plane by which root its iteration sequence converges to.

What this project does

  • Complex number arithmetic — a custom Complex class supporting the operations needed for root-finding on ℂ
  • Polynomial representation — a Polynomial class over ℂ[z], supporting efficient evaluation via nested (Horner's method) form rather than repeated exponentiation
  • Secant root-finding algorithm — implements the iterative scheme
  • z(n+1) = z(n) - f(z(n)) * (z(n) - z(n-1)) / (f(z(n)) - f(z(n-1))) which converges to a root without requiring the derivative of f (unlike Newton-Raphson), handling convergence, divergence, and non-convergence cases explicitly
  • Fractal generation — for a given polynomial and region of the complex plane, every pixel is mapped to a starting point, run through the Secant algorithm, and coloured according to which root it converges to (and optionally shaded by how many iterations it took) — producing fractal images like the classic root-finding fractals for f(z) = z³ - 1

Why this is interesting

Although the Secant method is a simple, well-understood numerical technique, which root a given starting point converges to is extremely sensitive to initial conditions — producing self-similar, fractal boundary structure between the basins of attraction of each root. This project explores that behaviour directly through visualisation.

Tools

Java, custom complex-number and polynomial arithmetic, PNG image generation

Files

  • Complex.java — complex number representation and arithmetic
  • Polynomial.java — polynomial representation and evaluation over ℂ
  • Secant.java — the Secant root-finding algorithm
  • Project2.java — fractal image generation and rendering
  • Fractal.pdf — example output for a chosen polynomial and region of the complex plane

About

Java implementation of the Secant root-finding method for complex polynomials, with fractal visualisation of convergence basins.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages