Commit ebeb914
committed
fix: correct 2D cross product formula in MathUtils
The cross product formula was incorrect:
- Before: p1x * p2x - p1y * p2y (wrong)
- After: p1x * p2y - p1y * p2x (correct)
The 2D cross product (perp dot product) should compute:
A × B = Ax * By - Ay * Bx
This returns the z-component of the 3D cross product when
treating 2D vectors as 3D vectors with z=0.
Also fixed the example comment to show correct result.1 parent 48f15d1 commit ebeb914
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
0 commit comments