Complete fractal generation configuration
Object containing the real and imaginary bounds of the viewing area
import { calculateBounds, defaultConfig } from './config.js';
// Calculate bounds for default view
const bounds = calculateBounds(defaultConfig);
console.log(`Real: [${bounds.minReal}, ${bounds.maxReal}]`);
console.log(`Imag: [${bounds.minImaginary}, ${bounds.maxImaginary}]`);
// Calculate bounds for zoomed view
const zoomedConfig = {
...defaultConfig,
centerX: -0.7269,
centerY: 0.1889,
zoom: 100
};
const zoomedBounds = calculateBounds(zoomedConfig);
// Calculate pixel-to-complex mapping
const realStep = (bounds.maxReal - bounds.minReal) / config.width;
const imagStep = (bounds.maxImaginary - bounds.minImaginary) / config.height;
Calculates the complex plane bounds for fractal rendering based on configuration
This function performs the critical coordinate transformation from screen/image coordinates to the complex plane coordinates needed for Mandelbrot calculations. It handles aspect ratio correction and zoom level mapping.