<commit_before>package de.domisum.lib.auxilium.data.container.bound;

import de.domisum.lib.auxilium.data.container.math.Vector2D;
import de.domisum.lib.auxilium.util.java.annotations.APIUsage;

public class DoubleBounds2D
{

	@APIUsage public final double minX;
	@APIUsage public final double maxX;
	@APIUsage public final double minY;
	@APIUsage public final double maxY;


	// INIT
	@APIUsage public DoubleBounds2D(double x1, double x2, double y1, double y2)
	{
		this.minX = Math.min(x1, x2);
		this.maxX = Math.max(x1, x2);
		this.minY = Math.min(y1, y2);
		this.maxY = Math.max(y1, y2);
	}


	// CHECKS
	@APIUsage public boolean contains(Vector2D point)
	{
		if(point.x < this.minX || point.x > this.maxX)
			return false;

		if(point.y < this.minY || point.y > this.maxY)
			return false;

		return true;
	}

}<commit_msg>Added #toRelative(Vector2D) method (DoubleBounds2D)<commit_after>package de.domisum.lib.auxilium.data.container.bound;

import de.domisum.lib.auxilium.data.container.math.Vector2D;
import de.domisum.lib.auxilium.util.java.annotations.APIUsage;
import de.domisum.lib.auxilium.util.math.MathUtil;

public class DoubleBounds2D
{

	@APIUsage public final double minX;
	@APIUsage public final double maxX;
	@APIUsage public final double minY;
	@APIUsage public final double maxY;


	// INIT
	@APIUsage public DoubleBounds2D(double x1, double x2, double y1, double y2)
	{
		this.minX = Math.min(x1, x2);
		this.maxX = Math.max(x1, x2);
		this.minY = Math.min(y1, y2);
		this.maxY = Math.max(y1, y2);
	}


	// CHECKS
	@APIUsage public boolean contains(Vector2D point)
	{
		if(point.x < this.minX || point.x > this.maxX)
			return false;

		if(point.y < this.minY || point.y > this.maxY)
			return false;

		return true;
	}


	// TRANSFORMS
	@APIUsage public Vector2D toRelative(Vector2D absolute)
	{
		double rX = MathUtil.remapLinear(this.minX, this.maxX, 0, 1, absolute.x);
		double rY = MathUtil.remapLinear(this.minY, this.maxY, 0, 1, absolute.y);

		return new Vector2D(rX, rY);
	}

}
{'fraction_non_alphanumeric': 0.1268025857782198, 'fraction_numerical': 0.020387866732968673, 'mean_word_length': 3.955665024630542, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '536581', 'n_tokens_mistral': 834, 'n_tokens_neox': 784, 'n_words': 173}