0
$\begingroup$

Is there a way to get the result of a cross product to be normalized after just a cross action, i.e. without doing after the cross v/|v|? (the vectors involved are not normalized, but they are orthogonal).

  • 0
    Why do you not want to perform a normalization after the cross product?2011-05-03
  • 0
    I am going to implement it in electrical hardware, normalizing vectors (making then unit vectors) is a costly procedure for me. And since I always need my cross products to be normalized I would prefer to implement the normalization in the cross to save time and calculation units.2011-05-03
  • 0
    If you really want to do less work, why normalise it at all?2011-05-03
  • 0
    Hi, Ilya, I am assuming you do need the resulting vectors to be normalized, I don't think there is a way to parallel the normalization with the cross product, but there are many fast inverse square root algorithms, e.g. Newton's method, please refer to http://en.wikipedia.org/wiki/Fast_inverse_square_root2011-05-03
  • 0
    One can actually set things up so that you can (iteratively) compute $\sqrt{x^2+y^2}$ (probably) more cheaply than squaring $x$ and $y$ and rooting their sum. If you're interested in that, you can ask a separate question and I'll be happy to elaborate.2011-05-04

1 Answers 1

1

If two vectors are orthogonal, then the length of their cross product is the product of their lengths. So if by "normalized" you mean length $1$, just divide by the product of the lengths of the two vectors.

  • 0
    calculating the length of a vector is a costly procedure, it requires 3 actions of `^2` and a `sqrt`, and then another multiplicator and a devider, those are costly units in both time and space I'm looking for some other way.2011-05-03
  • 5
    OK, I was answering the original version of the problem, where none of this was clear. But what makes you think there's a way to get a normalized vector without doing the work? There's no such thing as a free lunch. If you could do what you want, you could normal-cross $u=(a,b,c)$ with $v=(b,-a,0)$, then normal-cross the result with $v$ to get $u/|u|$, and thus get $|u|$ without any squaring or square root. Doesn't seem likely.2011-05-03
  • 0
    I don't know if there is such a way, I just hope so.2011-05-03
  • 0
    @Ilya: Is polar form cheaper?2011-05-03
  • 1
    @Emre: What is polar form? using `sin`? No, making a `sin` func is way more costly.2011-05-03
  • 0
    @Emre: If he already thinks square roots are expensive, then certainly trigonometric functions would be even more costly to evaluate.2011-05-04