8000 BUG: fixing incorrect rotation matrix · matplotlib/matplotlib@03865b1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 03865b1

Browse files
perimosocordiaemdboom
authored andcommitted
BUG: fixing incorrect rotation matrix
1 parent 57fb822 commit 03865b1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2533,8 +2533,9 @@ def calc_arrow(uvw, angle=15):
25332533
Rpos = np.array([[c+(x**2)*(1-c), x*y*(1-c), y*s],
25342534
[y*x*(1-c), c+(y**2)*(1-c), -x*s],
25352535
[-y*s, x*s, c]])
2536-
# opposite rotation negates everything but the diagonal
2537-
Rneg = Rpos * (np.eye(3)*2 - 1)
2536+
# opposite rotation negates all the sin terms
2537+
Rneg = Rpos.copy()
2538+
Rneg[[0,1,2,2],[2,2,0,1]] = -Rneg[[0,1,2,2],[2,2,0,1]]
25382539

25392540
# multiply them to get the rotated vector
25402541
return Rpos.dot(uvw), Rneg.dot(uvw)

0 commit comments

Comments
 (0)
0