<commit_before>package de.domisum.exziff.shape.generator;

import de.domisum.exziff.shape.RasterShape;

public class RasterShapeGeneratorCircle extends RasterShapeGenerator
{

	// SETTINGS
	private double relativeRadius;


	// -------
	// INITIALIZATION
	// -------
	public RasterShapeGeneratorCircle(int width, int height, double relativeRadius)
	{
		super(width, height);

		this.relativeRadius = relativeRadius;
	}


	// -------
	// GENERATION
	// -------
	@Override
	public void generate()
	{
		boolean[][] pixels = new boolean[this.height][this.width];
		for(int x = 0; x < this.width; x++)
			for(int y = 0; y < this.height; y++)
			{
				double relXFromCenter = (double) x/Math.min(this.width, this.height)-0.5;
				double relYFromCenter = (double) y/Math.min(this.width, this.height)-0.5;

				if(Math.sqrt(relXFromCenter*relXFromCenter+relYFromCenter*relYFromCenter) < this.relativeRadius)
					pixels[y][x] = true;
			}

		this.rasterShape = new RasterShape(pixels);
	}

}<commit_msg>Changed circle generator parameter to relative diameter from relative radius<commit_after>package de.domisum.exziff.shape.generator;

import de.domisum.exziff.shape.RasterShape;

public class RasterShapeGeneratorCircle extends RasterShapeGenerator
{

	// SETTINGS
	private double relativeDiameter;


	// -------
	// INITIALIZATION
	// -------
	public RasterShapeGeneratorCircle(int width, int height, double relativeDiameter)
	{
		super(width, height);

		this.relativeDiameter = relativeDiameter;
	}


	// -------
	// GENERATION
	// -------
	@Override
	public void generate()
	{
		boolean[][] pixels = new boolean[this.height][this.width];
		for(int x = 0; x < this.width; x++)
			for(int y = 0; y < this.height; y++)
			{
				double relXFromCenter = (double) x/Math.min(this.width, this.height)-0.5;
				double relYFromCenter = (double) y/Math.min(this.width, this.height)-0.5;

				if(Math.sqrt(relXFromCenter*relXFromCenter+relYFromCenter*relYFromCenter) < this.relativeDiameter/2)
					pixels[y][x] = true;
			}

		this.rasterShape = new RasterShape(pixels);
	}

}
{'fraction_non_alphanumeric': 0.15075133301017934, 'fraction_numerical': 0.006301502666020358, 'mean_word_length': 3.496732026143791, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1092288', 'n_tokens_mistral': 784, 'n_tokens_neox': 699, 'n_words': 135}