Skip to content

shz_mat3x3_adjugate

Markdown
SHZ_INLINE void shz_mat3x3_adjugate(const shz_mat3x3_t* mat, shz_mat3x3_t* out) SHZ_NOEXCEPT;

Computes the adjugate of a 3x3 matrix.

NameTypeDescription
matconst shz_mat3x3_t *Pointer to the 3x3 matrix whose adjugate is computed.
outshz_mat3x3_t *Pointer to the resulting adjugate matrix.

Nothing (void).

The adjugate is the inverse scaled by the determinant: adj(M) = det(M) * M^-1. It is defined for every matrix, including singular ones, and saves cycles over shz_mat3x3_inverse() by not computing or dividing by the determinant.

  • The transpose of the adjugate shares the direction of the inverse-transpose normal matrix, so it can be used to transform normals that are renormalized afterwards, even under non-uniform scale. A negative determinant flips them.
  • This routine clobbers XMTRX.
  • C++ equivalent: none (call the C function from C++)
  • Type-generic form: none
  • Back-ends: SH4: shared C implementation · SW: portable C · SPU: shared C implementation
  • Defined in: sh4zam/shz_matrix.h:1233
  • Module: Matrix, section "Functions"

shz_mat3x3_inverse