init(width=window.innerWidth, height=window.innerHeight) {
        // canvas width
        this._canvas.width = width;
        this._canvas.height = height;
        // canvas center
        const canvasCenterX = this._canvas.width / 2;
        const canvasCenterY = this._canvas.height / 2;

        return { canvasCenterX, canvasCenterY };
    } // init
/**
     * Handles all necessary operations when the window is resized.
     * This includes resizing the canvas and finding the canvas center.
     *
     * @param {number} [width=window.innerWidth]  the width of the canvas
     * @param {number} [width=window.innerHeight] the height of the canvas
     * @return {object} an object containing the canvas center's coordinates
     */
Handles all necessary operations when the window is resized.
This includes resizing the canvas and finding the canvas center.

@param {number} [width=window.innerWidth]  the width of the canvas
@param {number} [width=window.innerHeight] the height of the canvas
@return {object} an object containing the canvas center's coordinates
Handles all necessary operations when the window is resized . This includes resizing the canvas and finding the canvas center . @param { number } [ width = window . innerWidth ] the width of the canvas @param { number } [ width = window . innerHeight ] the height of the canvas @return { object } an object containing the canvas center ' s coordinates
init(width=window.innerWidth, height=window.innerHeight) {
        this._canvas.width = width;
        this._canvas.height = height;
        const canvasCenterX = this._canvas.width / 2;
        const canvasCenterY = this._canvas.height / 2;
        return { canvasCenterX, canvasCenterY };
    } 
init ( width = window . innerWidth , height = window . innerHeight ) { this . _canvas . width = width ; this . _canvas . height = height ; const canvasCenterX = this . _canvas . width / 2 ; const canvasCenterY = this . _canvas . height / 2 ; return { canvasCenterX , canvasCenterY } ; }
Handles all necessary operations when the window is resized.
Handles all necessary operations when the window is resized .
// canvas width // canvas center // init