Table Of Contents

Subspaces Angle (G Dataflow)

Last Modified: January 9, 2017

Computes the angle between column spaces of two matrices.

connector_pane_image
datatype_icon

vector a

A real vector.

This input accepts a 1D array of double-precision, floating-point numbers or a 2D array of double-precision, floating-point numbers. If this input is a 1D array of double-precision, floating-point numbers, you must wire a 1D array of double-precision, floating point numbers to vector b. This input changes to matrix A when the data type is a 2D array of double-precision, floating-point numbers.

Default: Empty array

datatype_icon

vector b

A real vector.

This input accepts a 1D array of double-precision, floating-point numbers or a 2D array of double-precision, floating-point numbers. This input changes to matrix B when the data type is a 2D array of double-precision, floating-point numbers.

The length of vector a or the number of rows in matrix A must equal the length of vector b or the number of rows in matrix B. Otherwise, the node returns NaN as the output angle and returns an error.

datatype_icon

matrix A

A real matrix.

This input accepts a 1D array of double-precision, floating-point numbers or a 2D array of double-precision, floating-point numbers. This input changes to vector a when the data type is a 1D array of double-precision, floating-point numbers.

datatype_icon

matrix B

A real matrix.

This input accepts a 1D array of double-precision, floating-point numbers or a 2D array of double-precision, floating-point numbers. This input changes to vector b when the data type is a 1D array of double-precision, floating-point numbers.

The length of vector a or the number of rows in matrix A must equal the length of vector b or the number of rows in matrix B. Otherwise, the node returns NaN as the output angle and returns an error.

datatype_icon

error in

Error conditions that occur before this node runs. The node responds to this input according to standard error behavior.

Default: No error

datatype_icon

angle

Angle, in radians, between the column subspaces of the inputs.

datatype_icon

error out

Error information. The node produces this output according to standard error behavior.

Algorithm for Calculating the Angle between Subspaces of Two Matrices or Two Vectors

Let U1S1V1T and U2S2V2T be the singular value decomposition of matrix A and matrix B, respectively. The following equation defines the angle between the Euclidean subspaces that span the columns of matrix A and matrix B.

angle = arccos ( s )

where s is the minimum singular value of U1TU2.

For inputs vector a and vector b, the previous equation equals the following equation.

angle = arccos ( a T b a b )

where a is the input vector a and b is the input vector b, and the norm symbols (||.||) compute the 2-norm of the input vectors.

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported


Recently Viewed Topics