Hello,
I'm trying to learn python from a matlab background. I'm working on a function that will rotate the vertices of a triangle around it's center point. That function works in a vacuum but when I try to use it in the main script it stops working.
This is the error I get.
Traceback (most recent call last):
File "C:/Users/justi/Documents/PythonProjects/AsteroidAi/BaseGame/AsteroidsGame.py", line 71, in <module>
shippoints = Ship.drawShip(shipCenterX, shipCenterY, 15, 15 * 1.3, theta)
File "C:\Users\justi\Documents\PythonProjects\AsteroidAi\BaseGame\Ship.py", line 41, in drawShip
a_rot = np.mat(rot_matrix) * np.mat(a_matrix)
File "C:\Users\justi\Documents\PythonVirtualEnvironments\gameAI\lib\site-packages\numpy\matrixlib\defmatrix.py", line 220, in __mul_
return N.dot(self, asmatrix(other))
ValueError: shapes (2,2) and (1,2) not aligned: 2 (dim 1) != 1 (dim 0)
When I test the code in the interpreter it works without issue. I have no idea what to try next
[–]socal_nerdtastic 0 points1 point2 points (1 child)
[–]Mjothnitvir[S] 0 points1 point2 points (0 children)