IsOrthogonal: Test for an Orthogonal Matrix

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/IsOrthogonal.R

Description

IsOrthogonal() returns TRUE if A is an orthogonal matrix, and FALSE otherwise.

Usage

1
2
3
4
5
6
7
IsOrthogonal(A, ...)

## Default S3 method:
IsOrthogonal(A, tol = 1e-08, ...)

## S3 method for class 'yac_symbol'
IsOrthogonal(A, ...)

Arguments

A

Input.

...

...

tol

Numeric. Tolerance.

Details

An m \times m matrix \mathbf{A} is orthogonal if

\mathbf{A}^{\mathsf{T}} \mathbf{A} = \mathbf{A} \mathbf{A}^{\mathsf{T}} \mathbf{I} .

Or equivalently

\mathbf{A}^{\mathsf{T}} = \mathbf{A}^{-1} .

A is considered to be an orthogonal matrix if all(abs(crossprod(A) - diag(dim(A)[1])) <= tol) returns TRUE.

Value

Logical.

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

Other predicate functions: IsDiagonal(), IsIdempotent(), IsInvertible(), IsMatrix(), IsNilpotent(), IsPositiveDefinite(), IsScalar(), IsSingular(), IsSquareMatrix(), IsSymmetric(), IsVector(), MatrixCheck()

Examples

1
2
3
4
5
# TRUE
IsOrthogonal(matrix(data = c(1, 0, 0, 1), ncol = 2))

# FALSE
IsOrthogonal(matrix(data = 1, nrow = 2, ncol = 2))

jeksterslab/matrixR documentation built on Feb. 22, 2021, 8:10 a.m.