# Synopsis

PDX_BOOL mth_CompareVector(int ndim, double *a, double *b, double toler)

# Purpose

Compare two vectors for equality.

# Description

The vectors a and b will be compared for equality with a tolerance toler defined as "Unit vector tolerance". Equality of the two vectors are compared based on the following consideration:

One of the vectors should fall into a Tolerance Ball at the tip of the other. The ball radius is obtained by magnifying the "Unit vector tolerance" by the maximum length of the two vectors. For one vector to fall into the other vector's Tolerance Ball, it is required that the magnitude of the difference of the two vectors be less than the Tolerance Ball radius.

# Input

## ndim

Number of dimensions in vectors

## a

First vector

## b

Second vector

## toler

Unit vector tolerance within which vectors of unit length are assumed to be equal.

# Tolerances

          MTH_ZERO_TOL
          .fi

# Return

PDX_TRUE

If vectors fall inside the Tolerance Ball, or their magnitude is already less than the tolerance.

.IP PDX_FALSE If vectors do not fall inside the specified tolerance. .LP