is_orthonormal: Orthonormality of a matrix

View source: R/0_util.r

is_orthonormalR Documentation

Orthonormality of a matrix

Description

Test if a numeric matrix is orthonormal, that is, each column is orthogonal, at a right angle with the others, and each column has a norm length of 1. This must be true for a projection to be linear.

Usage

is_orthonormal(x, tol = 0.001)

Arguments

x

Numeric matrix to test the orthonormality of.

tol

Max tolerance of floating point differences of the element-wise distance of t(x) %*% x from the identity matrix.

Value

Single logical, whether or not the matrix is orthonormal.

Examples

spinifex::is_orthonormal(tourr::basis_random(n = 6))
spinifex::is_orthonormal(matrix(1:12, ncol = 2), tol = 0.01)

nspyrison/spinifex documentation built on Feb. 7, 2024, 1:10 p.m.