public void Test_ComputeError(List <Vector4> XCs, List <Vector4> Ps, Vector4 translation, int[] xis, float intersection_weight, float distance_weight, float expected) { IntersectionTermError errorMetric = new IntersectionTermError(distance_weight, intersection_weight); double actual = errorMetric.ComputeError(XCs, Ps, translation, xis); Assert.That(actual, Is.EqualTo(expected).Within(precision)); }
public void Test_RotationalGradient(List <Vector4> XCs, List <Vector4> Ps, Vector4 translation, int[] xis, float intersection_weight, float distance_weight, Quaternion expected) { IntersectionTermError errorMetric = new IntersectionTermError(distance_weight, intersection_weight); Quaternion actual = errorMetric.RotationalGradient(XCs, Ps, translation, xis); for (int i = 0; i < 4; i++) { Assert.That(actual[i], Is.EqualTo(expected[i]).Within(precision)); } }