Timeline for Python 3 function to rotate an image 90°
Current License: CC BY-SA 4.0
19 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 17, 2019 at 20:00 | comment | added | Eric Duminil | @SeanValdivia: You could split the square in 4 "triangles", and rotate each cell inside those triangles one after the other. see geeksforgeeks.org/inplace-rotate-square-matrix-by-90-degrees for example | |
| Mar 17, 2019 at 19:55 | comment | added | MadHatter | @EricDuminil How could I do this dynamically, such as with a matrix of arbitrary height and length? | |
| Jan 5, 2019 at 1:51 | vote | accept | MadHatter | ||
| Jan 5, 2019 at 1:51 | vote | accept | MadHatter | ||
| Jan 5, 2019 at 1:51 | |||||
| Oct 18, 2018 at 17:52 | answer | added | Blindman67 | timeline score: 3 | |
| Sep 20, 2018 at 19:37 | vote | accept | MadHatter | ||
| Jan 5, 2019 at 1:51 | |||||
| Sep 20, 2018 at 19:30 | comment | added | Eric Duminil |
@NewbieWanKenobi: Yes, you can re-assign 4 values at the same time. As an example with a 2x2 matrix : m = [[1, 2], [3, 4]]; m[1][0], m[0][0], m[1][1], m[0][1] = m[0][0], m[0][1], m[1][0], m[1][1]; m
|
|
| Sep 20, 2018 at 18:41 | comment | added | MadHatter | @EricDuminil Is it possible to rotate the matrix in place? If so, how do we open a chat? | |
| Sep 20, 2018 at 12:20 | answer | added | Gareth Rees | timeline score: 23 | |
| Sep 20, 2018 at 9:36 | vote | accept | MadHatter | ||
| Sep 20, 2018 at 19:37 | |||||
| Sep 20, 2018 at 9:00 | history | tweeted | twitter.com/StackCodeReview/status/1042700030174486528 | ||
| Sep 20, 2018 at 8:36 | answer | added | Divakar | timeline score: 24 | |
| Sep 20, 2018 at 8:03 | comment | added | Eric Duminil |
Is it acceptable to rotate the matrix in place, without creating a new one? Is it acceptable to create a new class which redefines .__getitem__ for a rotation in O(1)?
|
|
| Sep 20, 2018 at 5:58 | comment | added | MadHatter | @200_success Yes the matrix is expected to always be proportional, i.e., the same length everywhere. | |
| Sep 20, 2018 at 5:52 | answer | added | user134596 | timeline score: 17 | |
| Sep 20, 2018 at 5:49 | comment | added | 200_success | In your analysis, what exactly is "n"? Are you implying that the matrix is necessarily square? | |
| Sep 20, 2018 at 5:48 | comment | added | user134596 |
O(N^2) wrt. N being the number of pixels or side of the squre?
|
|
| Sep 20, 2018 at 5:44 | history | edited | 200_success | CC BY-SA 4.0 |
added 10 characters in body; edited tags; edited title
|
| Sep 20, 2018 at 5:26 | history | asked | MadHatter | CC BY-SA 4.0 |