m2_polar_decomp
m2_polar_decomp(R, S, m)
Performs a polar decomposition of a 2x2 matrix.
This function decomposes a 2x2 matrix m into two matrices, R and S,
such that m = S * R, where:
- R is a 2x2 orthogonal matrix (representing a rotation).
- S is a 2x2 symmetric positive semi-definite matrix.
The input matrix
mand output matricesRandSare stored in a flattened, transposed format (consistent with the Taichi programming language convention).
Kind: global function
| Param | Type | Description |
|---|---|---|
| R | Array.<number> | Output: 2x2 orthogonal matrix (rotation), stored as a flattened array [c, s, -s, c], where 'c' is the cosine and 's' is the sine of the rotation angle. Modified in-place. |
| S | Array.<number> | Output: 2x2 symmetric positive semi-definite matrix, stored as a flattened array. Modified in-place. |
| m | Array.<number> | Input: 2x2 matrix, stored as a flattened, transposed array [a, b, c, d], representing the matrix [[a, c], [b, d]]. Will be read from, but NOT modified. |