search.cpan.org is shutting down
Steffen Müller > Math-Orthonormalize > Math::Orthonormalize
Module Version: 1.00

# NAME

Math::Orthonormalize - Gram-Schmidt Orthonormalization of vectors

# SYNOPSIS

```  use Math::Orthonormalize qw(:all);

my @base_of_r_2 = (
[2, 1],
[1, 3]
);
my \$vector = [1, 2, 3];

my @orthonormalized = orthonormalize(@base_of_r_2);
my @orthogonalized  = orthogonalize(@base_of_r_2);

my \$normalized      = normalize(\$vector);
my \$scaled          = scale(2, \$vector);
my \$scalar          = scalar_product(\$vector1, \$vector2);```

# DESCRIPTION

Math::Orthonormalize offers subroutines to compute normalized or non-normalized orthogonal bases of Euclidean vector spaces. That means: Given a vector base of R^n, it computes a new base of R^n whose individual vectors are all orthogonal. If those new base vectors all have a length of 1, the base is orthonormalized.

The module uses the Gram-Schmidt Algorithm.

## EXPORT

No subroutines are exported by default, but the standart Exporter semantics are in place, including the ':all' tag that imports all of the exportable subroutines which are listed below.

# SUBROUTINES

## orthonormalize

Takes any number (>1) of vectors (array refs of vector components) as argument which form a base (that is, they are linearly independent) and returns an orthogonalized and normalized base of the same vector space (that is, n new array references).

## orthogonalize

Takes any number (>1) of vectors (array refs of vector components) as argument which form a base (that is, they are linearly independent) and returns an orthogonalized base of the same vector space (that is, n new array references).

## normalize

Normalizes a vector. That is, it changes the vector length to 1 without changing the vector's direction.

Takes an array reference with the vector components as argument and returns a new array reference containing the normalized vector components.

## scale

Takes a scalar and a vector (array reference of vector components) as arguments. Multiplies every component of the vector by the specified scalar and returns a new array reference containing the scaled vector components.

## scalar_product

Computes the scalar product of two vectors. Expects two array references with vector components (same number of components) as argument and returns their scalar product.

# AUTHOR

Steffen Mueller, orthonormalize-module at steffen-mueller dot net