<commit_before>function step(curr, goal, speed) {
	speed = speed || 100;

	var distanceX = Math.abs(curr.x - goal.x);
	var distanceY = Math.abs(curr.y - goal.y);

	var directionX = distanceX / distanceY;
	var directionY = distanceY / distanceX;

	var stepX = Math.min(Math.min(speed, speed * directionX), distanceX);
	var stepY = Math.min(Math.min(speed, speed * directionY), distanceY);

	var newX = goal.x > curr.x ? curr.x + stepX : curr.x - stepX;
	var newY = goal.y > curr.y ? curr.y + stepY : curr.y - stepY;
	var newD = curr.d;
<commit_msg>@christopherobin helped me with the math :)<commit_after>function step(curr, goal, speed) {
	speed = speed || 100;

	var distanceX = goal.x - curr.x;
	var distanceY = goal.y - curr.y;

	var angle = Math.atan2(distanceY, distanceX);

	var stepX = speed * Math.cos(angle);
	var stepY = speed * Math.sin(angle);

	var newX = curr.x + (distanceX > 0 ? Math.min(stepX, distanceX) : Math.max(stepX, distanceX));
	var newY = curr.y + (distanceY > 0 ? Math.min(stepY, distanceY) : Math.max(stepY, distanceY));
	var newD = curr.d;

{'fraction_non_alphanumeric': 0.15060804490177737, 'fraction_numerical': 0.00841908325537886, 'mean_word_length': 3.692982456140351, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7406435', 'n_tokens_mistral': 411, 'n_tokens_neox': 406, 'n_words': 108}