import org.saturnclient.emotes.core.bend.LimbBend; /** Prints LimbBend results for check_port.py to compare with the Python port. */ public class CheckPort { public static void main(String[] args) { float[][] cases = { {-2, 10, 0.5f, 0, 0}, {-2, 10, 1.75f, 3.5f, 0}, {0, 12, 1.2f, 2.79f, 0}, {0, 12, 0.7f, 3.14159f, 1}, {0, 12, -0.9f, 1.0f, 1} }; float[][] points = { {0, 0, 0}, {1.5f, 3, -2.25f}, {-2.25f, 10.25f, 2.25f}, {2, -2.25f, 1}, {0.5f, 12.25f, -1} }; float[] out = new float[3]; for (float[] c : cases) { LimbBend b = c[4] == 1 ? LimbBend.anchoredAtEnd(c[0], c[1], c[2], c[3], 0.5f, 12) : new LimbBend(c[0], c[1], c[2], c[3], 0.5f, 12); for (float[] p : points) { b.bendPoint(p[0], p[1], p[2], out); System.out.printf("%f %f %f %f%n", out[0], out[1], out[2], b.angleAt(p[1])); } } } }