1 |
|
2 |
|
3 | # Function det
|
4 |
|
5 | Calculate the determinant of a matrix.
|
6 |
|
7 |
|
8 | ## Syntax
|
9 |
|
10 | ```js
|
11 | math.det(x)
|
12 | ```
|
13 |
|
14 | ### Parameters
|
15 |
|
16 | Parameter | Type | Description
|
17 | --------- | ---- | -----------
|
18 | `x` | Array | Matrix | A matrix
|
19 |
|
20 | ### Returns
|
21 |
|
22 | Type | Description
|
23 | ---- | -----------
|
24 | number | The determinant of `x`
|
25 |
|
26 |
|
27 | ## Examples
|
28 |
|
29 | ```js
|
30 | math.det([[1, 2], [3, 4]]) // returns -2
|
31 |
|
32 | const A = [
|
33 | [-2, 2, 3],
|
34 | [-1, 1, 3],
|
35 | [2, 0, -1]
|
36 | ]
|
37 | math.det(A) // returns 6
|
38 | ```
|
39 |
|
40 |
|
41 | ## See also
|
42 |
|
43 | [inv](inv.md)
|