def testLog(self): for i in range(100): theta = np.random.uniform(-np.pi, np.pi) R = SO2.fromAngle(theta) R.inv() logR_true = np.array([[0, -theta], [theta, 0]]) logR = SO2.log(R) self.assertAlmostEqual(logR[1,0], logR_true[1,0]) self.assertAlmostEqual(logR[0,1], logR_true[0,1])
def testVee(self): for i in range(100): theta_true = np.random.uniform(-np.pi, np.pi) R = SO2.fromAngle(theta_true) theta = SO2.vee(SO2.log(R)) self.assertAlmostEqual(theta, theta_true)