<commit_before>package de.tum.in.jrealityplugin.jogl;

import javax.vecmath.AxisAngle4d;
import javax.vecmath.Matrix4d;
import javax.vecmath.Vector3d;

public class Util {
	public static AxisAngle4d rotateFromTo(Vector3d from, Vector3d to) {
		double angle = from.angle(to);
		if (angle == 0)
			return new AxisAngle4d(new Vector3d(), 0);
		Vector3d axis = new Vector3d();
		axis.cross(from, to);
		axis.normalize();
		return new AxisAngle4d(axis, angle);
	}

	public static float[] matrix4dToFloatArray(Matrix4d m) {
		return new float[] { (float) m.m00, (float) m.m01, (float) m.m02,
				(float) m.m03, (float) m.m10, (float) m.m11, (float) m.m12,
				(float) m.m13, (float) m.m20, (float) m.m21, (float) m.m22,
				(float) m.m23, (float) m.m30, (float) m.m31, (float) m.m32,
				(float) m.m33 };
	}
}
<commit_msg>Fixed bug in degenerated cases<commit_after>package de.tum.in.jrealityplugin.jogl;

import javax.vecmath.AxisAngle4d;
import javax.vecmath.Matrix4d;
import javax.vecmath.Vector3d;

public class Util {
	public static AxisAngle4d rotateFromTo(Vector3d from, Vector3d to) {
		double angle = from.angle(to);
		Vector3d axis = new Vector3d();
		axis.cross(from, to);
		if (axis.epsilonEquals(new Vector3d(), 1E-8))
			return new AxisAngle4d(new Vector3d(1,0,0), 0);
		axis.normalize();
		return new AxisAngle4d(axis, angle);
	}

	public static float[] matrix4dToFloatArray(Matrix4d m) {
		return new float[] { (float) m.m00, (float) m.m01, (float) m.m02,
				(float) m.m03, (float) m.m10, (float) m.m11, (float) m.m12,
				(float) m.m13, (float) m.m20, (float) m.m21, (float) m.m22,
				(float) m.m23, (float) m.m30, (float) m.m31, (float) m.m32,
				(float) m.m33 };
	}
}

{'fraction_non_alphanumeric': 0.15397923875432526, 'fraction_numerical': 0.05709342560553633, 'mean_word_length': 3.6021220159151195, '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': '1460035', 'n_tokens_mistral': 791, 'n_tokens_neox': 705, 'n_words': 165}