This implementation uses DecompositionFactory.eig() from https://ejml.org.
Usage | Returns |
---|---|
Array.eigen() | Array |
Argument | Type | Details |
---|---|---|
this: input | Array | A square, 2D array from which to compute the eigenvalue decomposition. |
Examples
Code Editor (JavaScript)
print(ee.Array([[0, 0], [0, 0]]).eigen()); // [[0,0,1],[0,1,0]] print(ee.Array([[1, 0], [0, 0]]).eigen()); // [[1,1,0],[0,0,1]] print(ee.Array([[0, 1], [0, 0]]).eigen()); // [[0,0,1],[0,1,0]] print(ee.Array([[0, 0], [1, 0]]).eigen()); // [[0,-1,0],[0,0,-1]] print(ee.Array([[0, 0], [0, 1]]).eigen()); // [[1,0,1],[0,1,0]] print(ee.Array([[1, 1], [0, 0]]).eigen()); // [[1,1,0],[0,-1/√2,1/√2]] print(ee.Array([[0, 0], [1, 1]]).eigen()); // [[1,0,-1],[0,-1/√2,1/√2]]] print(ee.Array([[1, 0], [1, 0]]).eigen()); // [[1,1/√2,1/√2],[0,0,1]] print(ee.Array([[1, 0], [0, 1]]).eigen()); // [[1,1,0],[1,0,1]] print(ee.Array([[0, 1], [1, 0]]).eigen()); // [[1,1/√2,1/√2],[-1,1/√2,-1/√2]] print(ee.Array([[0, 1], [0, 1]]).eigen()); // [[1,1/√2,1/√2],[0,1,0]] print(ee.Array([[1, 1], [1, 0]]).eigen()); // [[1.62,0.85,0.53],[-0.62,0.53]] print(ee.Array([[1, 1], [0, 1]]).eigen()); // [[1,0,1],[1,1,0]] print(ee.Array([[1, 0], [1, 1]]).eigen()); // [[1,-1,0],[1,0,-1]] // [[1.62,-0.53,-0.85],[-0.62,-0.85,0.53]] print(ee.Array([[0, 1], [1, 1]]).eigen()); print(ee.Array([[1, 1], [1, 1]]).eigen()); // [[2,1/√2,1/√2],[0,1/√2,-1/√2]] var matrix = ee.Array([ [1, 0, 0], [0, 1, 0], [0, 0, 1]]); print(matrix.eigen()); // [[1,1,0,0],[1,0,1,0],[1,0,0,1]] var matrix = ee.Array([ [2, 0, 0], [0, 3, 0], [0, 0, 4]]); print(matrix.eigen()); // [[4,0,0,1],[3,0,1,0],[2,1,0,0]] matrix = ee.Array([ [1, 0, 0], [0, 0, 0], [0, 0, 0]]); print(matrix.eigen()); // [[1,1,0,0],[0,0,1,0],[0,0,0,1]] matrix = ee.Array([ [1, 1, 1], [1, 1, 1], [1, 1, 1]]); // [[3,-0.58,-0.58,-0.58],[0,0,-1/√2,1/√2],[0,-0.82,0.41,0.41]] print(matrix.eigen());
import ee import geemap.core as geemap
Colab (Python)
display(ee.Array([[0, 0], [0, 0]]).eigen()) # [[0, 0, 1], [0, 1, 0]] display(ee.Array([[1, 0], [0, 0]]).eigen()) # [[1, 1, 0], [0,0,1]] display(ee.Array([[0, 1], [0, 0]]).eigen()) # [[0, 0, 1], [0, 1, 0]] display(ee.Array([[0, 0], [1, 0]]).eigen()) # [[0, -1, 0], [0, 0, -1]] display(ee.Array([[0, 0], [0, 1]]).eigen()) # [[1, 0, 1], [0, 1, 0]] # [[1, 1, 0], [0, -1/√2, 1/√2]] display(ee.Array([[1, 1], [0, 0]]).eigen()) # [[1, 0, -1], [0, -1/√2, 1/√2]]] display(ee.Array([[0, 0], [1, 1]]).eigen()) # [[1, 1/√2, 1/√2], [0, 0, 1]] display(ee.Array([[1, 0], [1, 0]]).eigen()) display(ee.Array([[1, 0], [0, 1]]).eigen()) # [[1, 1, 0], [1, 0, 1]] # [[1, 1/√2, 1/√2], [-1, 1/√2, -1/√2]] display(ee.Array([[0, 1], [1, 0]]).eigen()) # [[1, 1/√2, 1/√2], [0, 1, 0]] display(ee.Array([[0, 1], [0, 1]]).eigen()) # [[1.62, 0.85, 0.53], [-0.62, 0.53]] display(ee.Array([[1, 1], [1, 0]]).eigen()) display(ee.Array([[1, 1], [0, 1]]).eigen()) # [[1, 0, 1], [1, 1, 0]] display(ee.Array([[1, 0], [1, 1]]).eigen()) # [[1, -1, 0], [1, 0, -1]] # [[1.62, -0.53, -0.85], [-0.62, -0.85, 0.53]] display(ee.Array([[0, 1], [1, 1]]).eigen()) # [[2, 1/√2, 1/√2], [0, 1/√2, -1/√2]] display(ee.Array([[1, 1], [1, 1]]).eigen()) matrix = ee.Array([ [1, 0, 0], [0, 1, 0], [0, 0, 1]]) display(matrix.eigen()) # [[1, 1, 0, 0], [1, 0, 1, 0], [1, 0, 0, 1]] matrix = ee.Array([ [2, 0, 0], [0, 3, 0], [0, 0, 4]]) display(matrix.eigen()) # [[4, 0, 0, 1], [3, 0, 1, 0], [2, 1, 0, 0]] matrix = ee.Array([ [1, 0, 0], [0, 0, 0], [0, 0, 0]]) display(matrix.eigen()) # [[1, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]] matrix = ee.Array([ [1, 1, 1], [1, 1, 1], [1, 1, 1]]) # [[3, -0.58, -0.58, -0.58], [0, 0, -1/√2, 1/√2], [0, -0.82, 0.41, 0.41]] display(matrix.eigen())