Advertisement

Quick Dot Product Question

Started by January 18, 2001 09:52 AM
1 comment, last by Moot 24 years ago
I''m currently writing a 2D Vector Class and am wondering if there''s an operator that''s commonly overloaded for the Dot Product. I''ve seen % used somewhere.
quote:
Original post by Moot

I''m currently writing a 2D Vector Class and am wondering if there''s an operator that''s commonly overloaded for the Dot Product. I''ve seen % used somewhere.



I would reccommend NOT using overloaded operators for ANY vector operations. It only serves to obfuscate what is really going on, and makes maintenance much harder later on. While it may be easier to type "%" than "Dot()", you end up with crap like:

myVec = foo + bar - boo % far;

Which is shitty to read later on. You can run into precedence problems also.

Advertisement
Ok, thanks Mr Anon.

This topic is closed to new replies.

Advertisement