Fractal generation configuration defining the sampling area
Number of sample points per dimension (default: 1000)
Array of boundary points with their coordinates and iteration counts
import { calculateSetBoundary } from './mandelbrot.js';
import { defaultConfig } from './config.js';
// Find boundary points in the classic view
const boundary = calculateSetBoundary({
...defaultConfig,
centerX: -0.5,
centerY: 0,
zoom: 1,
maxIterations: 256
}, 500);
console.log(`Found ${boundary.length} boundary points`);
// Analyze boundary complexity
const avgIterations = boundary.reduce((sum, p) => sum + p.iterations, 0) / boundary.length;
console.log(`Average boundary iterations: ${avgIterations}`);
// Find most interesting boundary points
const complex = boundary.filter(p => p.iterations > 200);
Points are considered on the boundary if their iteration count is between 50% and 100% of the maximum iterations, indicating they're near the escape threshold.
Calculates an approximate boundary of the Mandelbrot set within given bounds
This function samples points in the complex plane and identifies those that lie on or near the boundary of the Mandelbrot set. Boundary points are defined as those that escape after a significant number of iterations but before the maximum.