Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm implementing a dot unit in an electrical design, but I'm only interested in the sign of the result and not the magnitude. Is there a way to reduce the number of mathematical operations (mainly the multiplication operations) to get just the sign faster and with less space?

Right now I'm calculating it using: (a1,b1,c1).(a2,b2,c2)=a1.a2+b1.b2+c1.c2.

share|cite|improve this question
Anything special about your vectors? – J. M. May 3 '11 at 13:56
up vote 2 down vote accepted

Not really.


(10,20,29).(40,10,-20) = +20  
(10,20,30).(40,10,-20) = 0  
(10,20,31).(40,10,-20) = -20 

and there are no obvious shortcuts to find the signs.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.