# shz_mat3x3_adjugate

Source: https://sh4zam.com/api/matrix/shz_mat3x3_adjugate/

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

Computes the adjugate of a 3x3 matrix.

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `mat` | `const shz_mat3x3_t *` | Pointer to the 3x3 matrix whose adjugate is computed. |
| `out` | `shz_mat3x3_t *` | Pointer to the resulting adjugate matrix. |

## Returns

Nothing (`void`).

## Details

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.

## Notes

- 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.

## Warnings

- This routine clobbers XMTRX.

## Availability

- **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`](https://github.com/gyrovorbis/sh4zam/blob/6b22b851ad9ca109049f956dbbbecf7c519c959f/include/sh4zam/shz_matrix.h#L1233)
- **Module:** [Matrix](https://sh4zam.com/api/matrix/), section "Functions"

## See also

[`shz_mat3x3_inverse`](https://sh4zam.com/api/matrix/shz_mat3x3_inverse/)
