Share Pastebin
Guest
Public paste!

phlyingpenguin

By: a guest | Oct 2nd, 2008 | Syntax: Python | Size: 0.46 KB | Hits: 227 | Expires: Never
Copy text to clipboard
  1. from numpy import *
  2. import OpenGL
  3.  
  4. I = matrix([[1,0,0],
  5.                 [0,1,0],
  6.                 [0,0,1]])
  7.  
  8. S = matrix([2,0,0,0,3,0,0,0,1])
  9.  
  10. S = S.reshape(3,3)
  11.  
  12. T = matrix([1,0,4,0,1,-3,0,0,1]).reshape(3,3)
  13.  
  14. R = matrix([cos(pi/4), -sin(pi/4), 0, sin(pi/4), cos(pi/4), 0, 0, 0, 1]).reshape(3,3)
  15.  
  16. p = matrix([6,5,1]).reshape(3,1)
  17.  
  18. print "S*P"
  19. print S*p
  20. print "T*S*p"
  21. print T*S*p
  22. print "R*T*S*p"
  23. print R*T*S*p
  24. print "R*T*S"
  25. print R*T*S
  26. print "C = RTS, C*p"
  27. C = R*T*S
  28. print C*p