mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-25 15:07:57 +00:00
1.3 KiB
1.3 KiB
| layout |
|---|
| default |
Function sqrtm #
Calculate the principal square root of a square matrix.
The principal square root matrix X of another matrix A is such that X * X = A.
https://en.wikipedia.org/wiki/Square_root_of_a_matrix
Syntax #
X = math.sqrtm(A)
Parameters #
| Parameter | Type | Description |
|---|---|---|
A |
Array | Matrix | The square matrix A |
Returns #
| Type | Description |
|---|---|
| Array | Matrix | The principal square root of matrix A |
Throws #
| Type | Description |
|---|
Examples #
math.sqrtm([[1, 2], [3, 4]]) // returns [[-2, 1], [1.5, -0.5]]