Skip to content

Instantly share code, notes, and snippets.

@tshev
Last active August 29, 2015 14:00
Show Gist options
  • Save tshev/11376520 to your computer and use it in GitHub Desktop.
Save tshev/11376520 to your computer and use it in GitHub Desktop.
Vector transforamtion between Oz. You shoult be attentive whith floating poing.
#!/usr/bin/python
import numpy
def transformOzVector(alpha, vector):
m = numpy.matrix([[numpy.math.cos(alpha), -numpy.math.sin(alpha), 0],
[numpy.math.sin(alpha), numpy.math.cos(alpha), 0],
[0, 0, 1]])
return m*vector
result = transformOzVector(numpy.math.pi*1, numpy.matrix([1,0,0]).T)
print result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment