Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

__init__.py 629 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  1. import numpy as np
  2. import math
  3. from .umeyama import umeyama
  4. def get_power_of_two(x):
  5. i = 0
  6. while (1 << i) < x:
  7. i += 1
  8. return i
  9. def rotationMatrixToEulerAngles(R) :
  10. sy = math.sqrt(R[0,0] * R[0,0] + R[1,0] * R[1,0])
  11. singular = sy < 1e-6
  12. if not singular :
  13. x = math.atan2(R[2,1] , R[2,2])
  14. y = math.atan2(-R[2,0], sy)
  15. z = math.atan2(R[1,0], R[0,0])
  16. else :
  17. x = math.atan2(-R[1,2], R[1,1])
  18. y = math.atan2(-R[2,0], sy)
  19. z = 0
  20. return np.array([x, y, z])
  21. def polygon_area(x,y):
  22. return 0.5*np.abs(np.dot(x,np.roll(y,1))-np.dot(y,np.roll(x,1)))
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...