Feedback
Add allocation-free vector perpendiculars, 2x2 matrix inverse and solve, and Double.IsFinite
- Status
- Fixed
- Fixed in
- v26.9.1
- Area
- -
- Source discussion
- -
- Last updated
- 2026-09-08
Upvotes
0 upvotes
Uses your Objo forum account.
Public summary
Add four small, generally useful maths capabilities requested by the Physics2D physics-library port and valuable to any 2D maths code:
Vector2.LeftPerpendicular()andVector2.RightPerpendicular()— in-place 90-degree rotations,(-y, x)and(y, -x), returning the vector for chaining. These provide allocation-free perpendicular and scalar/vector cross-product forms, complementing the existing allocatingVector2.Cross(scalar, v)/Vector2.Cross(v, scalar)overloads.Matrix.Inverse(),Matrix.Inverse(out), andMatrix.InvertSelf()— the 2x2 inverse. A singular matrix (zero determinant) inverts to the zero matrix, matching common 2D-physics conventions.Matrix.Solve(b)andMatrix.Solve(b, out)— solveMatrix * x = bfor aVector2xwithout forming the inverse. A singular matrix solves to the zero vector.Double.IsFinite()—Truewhen the value is neither NaN nor infinity, clearer thanNot v.IsNaN() And Not v.IsInfinity().