Real part of the complex number
Imaginary part of the complex number
Maximum iterations to test (default: 100)
True if point is likely in the Mandelbrot set, false otherwise
import { isInMandelbrotSet } from './mandelbrot.js';
// Test some known points
console.log(isInMandelbrotSet(0, 0)); // true - origin is in set
console.log(isInMandelbrotSet(-1, 0)); // true - on real axis
console.log(isInMandelbrotSet(1, 1)); // false - clearly outside
console.log(isInMandelbrotSet(-0.7269, 0.1889, 1000)); // depends on iterations
// Create binary visualization
const isInSet = isInMandelbrotSet(-0.5, 0.5, 256);
const color = isInSet ? 'black' : 'white';
mandelbrotIteration for detailed iteration count
Quick check if a point belongs to the Mandelbrot set
This is a convenience function that returns a boolean result instead of iteration count. Useful for set membership testing and creating binary visualizations.