function render(region, maxSteps) {
    let matrix = createMatrix(region.width, region.height);
    let realDelta = (region.lastPoint.real - region.firstPoint.real) / (region.width - 1);
    let imagDelta = (region.lastPoint.imag - region.firstPoint.imag) / (region.height - 1);

    for (let x = 0; x < region.width; x++) {
        for (let y = 0; y < region.height; y++) {
            let point = region.firstPoint.add(new Complex(x * realDelta, y * imagDelta));
            matrix[x][y] = escapeTime(point, maxSteps)
        }
    }

    return matrix;
}
/**
 * Renders the specified region of the complex plane into a matrix.
 * Returns the matrix with the escape time value for each rendered pixel.
 *
 * The region object must contain the following properties:
 *   - width: Width of the render in pixels
 *   - height: Height of the render in pixels
 *   - firstPoint: Bottom-left point of the complex region
 *   - lastPoint: Upper-right point of the complex region
 */
Renders the specified region of the complex plane into a matrix.
Returns the matrix with the escape time value for each rendered pixel.


Renders the specified region of the complex plane into a matrix . Returns the matrix with the escape time value for each rendered pixel .
function render(region, maxSteps) {
    let matrix = createMatrix(region.width, region.height);
    let realDelta = (region.lastPoint.real - region.firstPoint.real) / (region.width - 1);
    let imagDelta = (region.lastPoint.imag - region.firstPoint.imag) / (region.height - 1);
    for (let x = 0; x < region.width; x++) {
        for (let y = 0; y < region.height; y++) {
            let point = region.firstPoint.add(new Complex(x * realDelta, y * imagDelta));
            matrix[x][y] = escapeTime(point, maxSteps)
        }
    }
    return matrix;
}
function render ( region , maxSteps ) { let matrix = createMatrix ( region . width , region . height ) ; let realDelta = ( region . lastPoint . real - region . firstPoint . real ) / ( region . width - 1 ) ; let imagDelta = ( region . lastPoint . imag - region . firstPoint . imag ) / ( region . height - 1 ) ; for ( let x = 0 ; x < region . width ; x ++ ) { for ( let y = 0 ; y < region . height ; y ++ ) { let point = region . firstPoint . add ( new Complex ( x * realDelta , y * imagDelta ) ) ; matrix [ x ] [ y ] = escapeTime ( point , maxSteps ) } } return matrix ; }
Renders the specified region of the complex plane into a matrix.
Renders the specified region of the complex plane into a matrix .