Re: order of eigenvalues



"Willem Geert " <wgphaff@xxxxxxxxx> wrote in message <fnv8sh$puv
$1@xxxxxxxxxxxxxxxxxx>...
...........
Using the angle between the differenct is also an option,
but not based on the cosine; round-off error is too large.
...........
----------
Willem, if you are worried about accuracy in determining when vectors are
nearly parallel, there is a more accurate alternative as compared with finding
their scalar product and comparing its absolute value to 1, though it requires
more computation. The scalar product is the product of the norms of the
vectors multiplied by the cosine of the angle between them. As you
indicated, there is a loss of accuracy due to the infinite slope that is
approached by the arccosine function as its argument approaches 1 or -1.
Instead, we can directly compute the absolute value of the sine of the angle
between vectors in the following manner.

The absolute value of the sine of the angle between two real n-dimensional
(n-element) column vectors v and w is given in matlab by

norm(t(:))/sqrt(2)/norm(v)/norm(w)

where t is computed as

t = v*w.'-w*v.';

Of course with unit-length eigenvectors, the division by norm(v) and norm(w)
can be omitted. Unfortunately, finding t and norm(t(:)) are order n^2
computations.

When this sine quantity is nearly zero, the vectors are nearly parallel, even if
pointing in opposite directions. It should also be noted that this same
quantity approaches zero even when v and w are complex-valued and are
nearly parallel in the complex sense that one is nearly a complex scalar
multiple of the other, as can occur with eigenvectors of non-Hermitian
matrices.

Note: Just for the record, you can get the actual angle between the real
vectors, lying in the range 0 to pi, using

ang = atan2(norm(t(:))/sqrt(2),dot(v,w));

Roger Stafford

.



Relevant Pages

  • Re: how to get the angle from the cosine, etc.
    ... >that you already have the sine and cosine of the angle. ... What we are forced to do is to _define_ the inverse cosine as a new ... If you also know the sine, then you have a unique solution within ...
    (sci.math)
  • Re: Golly, that was easy...
    ... addition formulas for cosine and sine. ... 'a' to keep track of both the sine and cosine of the angle. ...
    (sci.physics)
  • Re: double pointers
    ... double sincostan(double angle, double *pcosine, double *ptangent) ... double cosine = cos; ... double tangent = tan; ... return sine; ...
    (comp.programming)
  • The Euler Equation: What does "e" have to do with sine & cosine?
    ... Euler Equation post... ... what does the number "e" have to do with sine and cosine? ... between (i.e. at an angle of pi/4 radians), and has a real part and an ...
    (sci.math)
  • Re: how to get the angle from the cosine, etc.
    ... > that you already have the sine and cosine of the angle. ... If you know the sine, then you also know the cosine. ... is just the sine function translated by 90 degrees or PI/2 radians. ...
    (sci.math)