ArViewer  Android Version
Arvos - Augmented reality viewer open source
 All Classes Namespaces Files Functions Variables
Static Public Member Functions | List of all members
com.mission_base.arviewer_android.viewer.utilities.MatrixUtils Class Reference

Static Public Member Functions

static void transpose (float[][] m, float[][] result)
 
static float[][] matrix (float[] v)
 
static void inverse (float[][] in, float[][] out)
 
static void transpose (float[] m, float[] result)
 
static void normalize (float[] vector)
 
static void normalize (int[] vector)
 
static void copy (float[] from, float[] to)
 
static void multiply (float[][] m1, float[][] m2, float[][] result)
 
static void scalarMultiply (float[] vector, float scalar)
 
static void scalarMultiply (int[] vector, int scalar)
 
static void identity (float[][] matrix)
 
static float dot (float[] v1, float[] v2)
 
static void cross (float[] p1, float[] p2, float[] result)
 
static void cross (int[] p1, int[] p2, int[] result)
 
static float magnitude (float[] vector)
 
static int magnitude (int[] vector)
 
static void rotateZ (float[] v, float angle, float[] out)
 
static void rotateY (float[] v, float angle, float[] out)
 
static void multiply (float[][] matrix, float[] vector, float[] res)
 
static void printMatrix (float[][] matrix)
 
static void homogenize (float[] pt)
 
static void printVector (float[] vec)
 
static void minus (float[] a, float[] b, float[] result)
 
static void minus (int[] a, int[] b, int[] result)
 
static void plus (float[] a, float[] b, float[] result)
 
static void plus (int[] a, int[] b, int[] result)
 

Detailed Description

Definition at line 24 of file MatrixUtils.java.

Member Function Documentation

static void com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.copy ( float[]  from,
float[]  to 
)
static

Copy a vector from from into to

Parameters
fromThe source
toThe destination

Definition at line 166 of file MatrixUtils.java.

static void com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.cross ( float[]  p1,
float[]  p2,
float[]  result 
)
static

Compute the cross product of two vectors

Parameters
v1The first vector
v2The second vector
resultWhere to store the cross product

Definition at line 264 of file MatrixUtils.java.

static void com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.cross ( int[]  p1,
int[]  p2,
int[]  result 
)
static

Compute the cross product of two vectors

Parameters
v1The first vector
v2The second vector
resultWhere to store the cross product

Definition at line 281 of file MatrixUtils.java.

static float com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.dot ( float[]  v1,
float[]  v2 
)
static

Compute the dot product of two vectors

Parameters
v1The first vector
v2The second vector
Returns
v1 dot v2

Definition at line 246 of file MatrixUtils.java.

static void com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.homogenize ( float[]  pt)
static

Homogenize a point (divide by its last element)

Parameters
ptThe point Modified

Definition at line 377 of file MatrixUtils.java.

static void com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.identity ( float  matrix[][])
static

Create the identity matrix I

Parameters
matrixThe matrix to store the identity matrix in.

Definition at line 230 of file MatrixUtils.java.

static void com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.inverse ( float  in[][],
float  out[][] 
)
static

Definition at line 54 of file MatrixUtils.java.

static float com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.magnitude ( float[]  vector)
static

Compute the magnitude (length) of a vector

Parameters
vectorThe vector
Returns
The magnitude of the vector

Definition at line 295 of file MatrixUtils.java.

static int com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.magnitude ( int[]  vector)
static

Compute the magnitude (length) of a vector

Parameters
vectorThe vector
Returns
The magnitude of the vector

Definition at line 307 of file MatrixUtils.java.

static float [][] com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.matrix ( float[]  v)
static

Definition at line 42 of file MatrixUtils.java.

static void com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.minus ( float[]  a,
float[]  b,
float[]  result 
)
static

Subtracts two vectors (a-b).

Parameters
aThe first vector
bThe second vector
resultStorage for the result, if null, store in a.

Definition at line 404 of file MatrixUtils.java.

static void com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.minus ( int[]  a,
int[]  b,
int[]  result 
)
static

Subtracts two vectors (a-b).

Parameters
aThe first vector
bThe second vector
resultStorage for the result, if null, store in a.

Definition at line 421 of file MatrixUtils.java.

static void com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.multiply ( float  m1[][],
float  m2[][],
float  result[][] 
)
static

Multiply two matrices by each other and store the result. result = m1 x m2

Parameters
m1The first matrix
m2The second matrix
reusltWhere to store the product of m1 x m2

Definition at line 185 of file MatrixUtils.java.

static void com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.multiply ( float  matrix[][],
float[]  vector,
float[]  res 
)
static

Multiply a vector and a matrix. result = matrix x vector

Parameters
matrixThe matrix.
vectorThe vector
resultThe result of the multiplication

Definition at line 347 of file MatrixUtils.java.

static void com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.normalize ( float[]  vector)
static

Converts this vector into a normalized (unit length) vector Modifies the input parameter

Parameters
vectorThe vector to normalize

Definition at line 141 of file MatrixUtils.java.

static void com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.normalize ( int[]  vector)
static

Converts this vector into a normalized (unit length) vector Modifies the input parameter

Parameters
vectorThe vector to normalize

Definition at line 153 of file MatrixUtils.java.

static void com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.plus ( float[]  a,
float[]  b,
float[]  result 
)
static

Adds two vectors (a+b).

Parameters
aThe first vector
bThe second vector
resultStorage for the result, if null, store in a.

Definition at line 438 of file MatrixUtils.java.

static void com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.plus ( int[]  a,
int[]  b,
int[]  result 
)
static

Adds two vectors (a+b).

Parameters
aThe first vector
bThe second vector
resultStorage for the result, if null, store in a.

Definition at line 455 of file MatrixUtils.java.

static void com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.printMatrix ( float  matrix[][])
static

Pretty print a matrix to stdout.

Parameters
matrixThe matrix

Definition at line 361 of file MatrixUtils.java.

static void com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.printVector ( float[]  vec)
static

Pretty print a vector

Parameters
vecThe vector to print

Definition at line 388 of file MatrixUtils.java.

static void com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.rotateY ( float[]  v,
float  angle,
float[]  out 
)
static

Definition at line 325 of file MatrixUtils.java.

static void com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.rotateZ ( float[]  v,
float  angle,
float[]  out 
)
static

Definition at line 313 of file MatrixUtils.java.

static void com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.scalarMultiply ( float[]  vector,
float  scalar 
)
static

Multiply a vector by a scalar. Modifies the input vector

Parameters
vectorThe vector
scalarThe scalar

Definition at line 204 of file MatrixUtils.java.

static void com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.scalarMultiply ( int[]  vector,
int  scalar 
)
static

Multiply a vector by a scalar. Modifies the input vector

Parameters
vectorThe vector
scalarThe scalar

Definition at line 218 of file MatrixUtils.java.

static void com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.transpose ( float  m[][],
float  result[][] 
)
static

Returns the transpose of a 4x4 matrix

Parameters
mThe matrix to transpose
resultThe place to store the transposed matrix

Definition at line 35 of file MatrixUtils.java.

static void com.mission_base.arviewer_android.viewer.utilities.MatrixUtils.transpose ( float[]  m,
float[]  result 
)
static

Definition at line 127 of file MatrixUtils.java.


The documentation for this class was generated from the following file: