The problem is that you are using the same VectorUtil object as the source
and destination of your calculations. You need to either alter the
cross() method so that it returns the cross product calculation, ie. u =
u.cross(v); or you need to create temporary doubles in the cross() method
to store the initial values of u, then use those values in the computation
of the cross product.
As it is, you are computing u.x in the first line of your method, then
usingthat recently changed u.x value to compute u.y, when you really need
to use the original value of u.x.
I hope this makes sense. I couldn't get the attached code into this reply
easily, but if I haven't made myself clear, ask again, and I'll go through
the slight inconvenience of editing the code.
Your lazy helper,
Richard Hall
Network Services
University of Tennessee