UNPKG

758 BMarkdownView Raw
1<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
2
3# Function sqrtm
4
5Calculate the principal square root of a square matrix.
6The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.
7
8https://en.wikipedia.org/wiki/Square_root_of_a_matrix
9
10
11## Syntax
12
13```js
14X = math.sqrtm(A)
15```
16
17### Parameters
18
19Parameter | Type | Description
20--------- | ---- | -----------
21`A` | Array &#124; Matrix | The square matrix `A`
22
23### Returns
24
25Type | Description
26---- | -----------
27Array &#124; Matrix | The principal square root of matrix `A`
28
29
30## Examples
31
32```js
33math.sqrtm([[1, 2], [3, 4]]) // returns [[-2, 1], [1.5, -0.5]]
34```
35
36
37## See also
38
39[sqrt](sqrt.md),
40[pow](pow.md)