public void ConsistentAndCorrect() { for (int i = 0; i < count / 100; i++) { var x = Rot.Distance(A[i], B[i]); var y = Rot.DistanceFast(A[i], B[i]); // Consistency Assert.IsTrue(Fun.ApproximateEquals(x, y, __eps__), "Solutions do not match{0} != {1}", x, y); // Correctness Assert.GreaterOrEqual(x, 0); Assert.LessOrEqual(x, (__rtype__)Constant.Pi); Assert.IsTrue(Fun.ApproximateEquals(x, angles[i], __eps__), "Solution does not match reference {0} != {1}", x, angles[i]); } }
public static bool ApproximateEquals(this Rot2f r0, Rot2f r1, float tolerance) { return(Rot.Distance(r0, r1) <= tolerance); }
public static bool ApproximateEquals(this __type__ r0, __type__ r1, __ftype__ tolerance) { return(Rot.Distance(r0, r1) <= tolerance); }