<commit_before>package com.adamldavis.z;

import java.awt.geom.Point2D;

// Assume left-to-right.

public class BloomZNodePositioner extends AbstractZNodePositioner {

	static final int maxSize = 15;

	@Override
	protected Point2D getDependencyPosition(ZNode node, int index, int size) {
		return getXPoint(1.5, index, size);
	}

	@Override
	protected Point2D getSubmodulePosition(ZNode node, int index, int size) {
		return getXPoint(0.5, index, size);
	}

	private Point2D getXPoint(final double start, int index, int size) {
		return getXPoint(getYAngle(start, index, size), index / maxSize);
	}

	private Point2D getXPoint(final double angle, int pow) {
		float x = (float) (Math.cos(angle) * 0.8 * Math.pow(0.5, pow));
		float y = (float) (Math.sin(angle) * 0.8 * Math.pow(0.5, pow));

		return new Point2D.Float(x, y);
	}

	private double getYAngle(final double start, int index, int size) {
		int smin = Math.min(maxSize, size);
		final double smin1 = smin + 1.0;

		return Math.PI * (start - (1.0 / smin1) - (index % maxSize / smin1));
	}

}<commit_msg>Fixed ordering of nodes in BloomZNodePositioner<commit_after>package com.adamldavis.z;

import java.awt.geom.Point2D;

// Assume left-to-right.

public class BloomZNodePositioner extends AbstractZNodePositioner {

	static final int maxSize = 15;

	@Override
	protected Point2D getDependencyPosition(ZNode node, int index, int size) {
		return getXPoint(-1.5, index, size);
	}

	@Override
	protected Point2D getSubmodulePosition(ZNode node, int index, int size) {
		return getXPoint(-0.5, index, size);
	}

	private Point2D getXPoint(final double start, int index, int size) {
		return getXPoint(getYAngle(start, index, size), index / maxSize);
	}

	private Point2D getXPoint(final double angle, int pow) {
		float x = (float) (Math.cos(angle) * 0.8 * Math.pow(0.5, pow));
		float y = (float) (Math.sin(angle) * 0.8 * Math.pow(0.5, pow));

		return new Point2D.Float(x, y);
	}

	private double getYAngle(final double start, int index, int size) {
		int smin = Math.min(maxSize, size);
		final double smin1 = smin + 1.0;

		return Math.PI * (start + (1.0 / smin1) + (index % maxSize / smin1));
	}

}
{'fraction_non_alphanumeric': 0.12604263206672844, 'fraction_numerical': 0.025023169601482854, 'mean_word_length': 4.068075117370892, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1682872', 'n_tokens_mistral': 816, 'n_tokens_neox': 768, 'n_words': 221}