Skip to content

Commit 6835529

Browse files
authored
Add migration guide for #20522 (#20525)
# Objective #20522 counts as a breaklng change, but didn't have a migration guide. ## Solution Add the migration guide :D
1 parent 5bc5a13 commit 6835529

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: "Fix `From<Rot2>` implementation for `Mat2`"
3+
pull_requests: [20522]
4+
---
5+
6+
Past releases had an incorrect `From<Rot2>` implementation for `Mat2`, constructing a rotation matrix in the following form:
7+
8+
```text
9+
[ cos, sin ]
10+
[ -sin, cos ]
11+
```
12+
13+
This was actually the *inverse* of the rotation matrix, resulting in clockwise rotation when transforming vectors.
14+
The correct version is the following:
15+
16+
```text
17+
[ cos, -sin ]
18+
[ sin, cos ]
19+
```
20+
21+
resulting in counterclockwise rotation.
22+
23+
This error has now been fixed. You may see that rotation matrices created using the `From<Rot2>` implementation
24+
produce different results than before, as the rotation happens counterclockwise (as intended) rather than clockwise.
25+
Invert either the input `Rot2` or the resulting `Mat2` to get the same results as before.

0 commit comments

Comments
 (0)