Package jexer.bits
Class MathUtils
- java.lang.Object
-
- jexer.bits.MathUtils
-
public class MathUtils extends java.lang.Object
MathUtils contains miscellaneous mathemathical computations.The eigenvector functions are ultimately based on the public-domain JAMA code. These specific ones were made available by Connelly Barnes at: http://barnesc.blogspot.com/2007/02/eigenvectors-of-3x3-symmetric-matrix.html
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
eigen3(double[][] A, double[][] V, double[] d)
Compute the eigenvalues and eigenvectors of a symmetric 3x3 matrix.static void
main(java.lang.String[] args)
Test the eigenvector code.
-
-
-
Method Detail
-
eigen3
public static void eigen3(double[][] A, double[][] V, double[] d)
Compute the eigenvalues and eigenvectors of a symmetric 3x3 matrix. Coordinates for the matrices are as A[row][col] and V[row][col].- Parameters:
A
- input: the 3x3 matrix. It must be symmetric.V
- output: the eigenvectors. Each column is a vector. The first column (V[0][0], V[1][0], V[2][0]) will correspond to the first eigenvector (d[0]), the second column (V[0][1], V[1][1], V[2][1]) will correspond to the second eigenvector (d[1]), and the third column (V[0][2], V[1][2], V[2][2]) will correspond to the third eigenvector (d[2]).d
- output: the eigenvalues. These will be sorted smallest to largest.
-
main
public static void main(java.lang.String[] args)
Test the eigenvector code.- Parameters:
args
- command line arguments
-
-