arc(x, y, radius, startAngle, endAngle, anticlockwise = false) {
		// based on from https://github.com/karellodewijk/canvas-webgl/blob/master/canvas-webgl.js
		//bring angles all in [0, 2*PI] range
		if (startAngle === endAngle) {
			return;
		}
		const fullCircle = anticlockwise
			? Math.abs(startAngle - endAngle) >= TAU
			: Math.abs(endAngle - startAngle) >= TAU;

		startAngle = startAngle % TAU;
		endAngle = endAngle % TAU;

		if (startAngle < 0) {
			startAngle += TAU;
		}
		if (endAngle < 0) {
			endAngle += TAU;
		}

		if (startAngle >= endAngle) {
			endAngle += TAU;
		}

		let diff = endAngle - startAngle;
		let direction = 1;
		if (anticlockwise) {
			direction = -1;
			diff = TAU - diff;
		}

		if (fullCircle) {
			diff = TAU;
		}

		const length = diff * radius;
		const nr_of_interpolation_points = length / this.arcResolution;
		const dangle = diff / nr_of_interpolation_points;
		const angleStep = dangle * direction;

		this.moveTo(
			x + radius * Math.cos(startAngle),
			y + radius * Math.sin(startAngle),
		);

		let angle = startAngle;
		for (let j = 0; j < nr_of_interpolation_points; j++) {
			this.lineTo(x + radius * Math.cos(angle), y + radius * Math.sin(angle));
			angle += angleStep;
		}

		this.lineTo(
			x + radius * Math.cos(endAngle),
			y + radius * Math.sin(endAngle),
		);

		this.isDirty = true;
	}
adds an arc to the current path which is centered at (x, y) position with the given radius,
starting at startAngle and ending at endAngle going in the given direction by counterclockwise (defaulting to clockwise).
@param {number} x - the horizontal coordinate of the arc's center.
@param {number} y - the vertical coordinate of the arc's center.
@param {number} radius - the arc's radius. Must be positive.
@param {number} startAngle - the angle at which the arc starts in radians, measured from the positive x-axis.
@param {number} endAngle - the angle at which the arc ends in radians, measured from the positive x-axis.
@param {boolean} [anticlockwise=false] - an optional boolean value. If true, draws the arc counter-clockwise between the start and end angles.