Skip to main content

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 m and output matrices R and S are stored in a flattened, transposed format (consistent with the Taichi programming language convention).

Kind: global function

ParamTypeDescription
RArray.<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.
SArray.<number>Output: 2x2 symmetric positive semi-definite matrix, stored as a flattened array. Modified in-place.
mArray.<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.