Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. def transfromPoint(x, point):
  2. Rx = np.matrix(np.array([
  3. [1, 0, 0],
  4. [0, cos(x[3]), -sin(x[3])],
  5. [0, sin(x[3]), cos(x[3])]
  6. ]))
  7. Ry = np.matrix(np.array([
  8. [cos(x[4]), 0, sin(x[4])],
  9. [0, 1, 0],
  10. [-sin(x[4]), 0, cos(x[4])]
  11. ]))
  12. Rz = np.matrix(np.array([
  13. [cos(x[5]), -sin(x[5]), 0],
  14. [sin(x[5]), cos(x[5]), 0],
  15. [0, 0, 1]
  16. ]))
  17. tempM = np.matmul(Rz, Ry)
  18. M = np.matmul(tempM, Rx)
  19. matrixM = np.matrix(M)
  20. R = point * matrixM
  21. print(point)
  22. print(R)
  23. R = R.tolist()[0]
  24. print(R)
  25. R[0] = R[0] + x[0]
  26. R[1] = R[1] + x[1]
  27. R[2] = R[2] + x[2]
  28. return R
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement