Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
How is my code?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Darren Grant, post: 1474215"] Ok, avoid friendship where you don't need, fair enough. Oh? "To add two (or more) vectors together, all you have to do is add the respective components together." "u + v = <u_x + v_x, u_y + v_y>" (from Tricks of the 3D Game Programming Gurus by Andre Lamothe). Similarly for subtraction. Scaling is done with multiplication by a scalar: if (r == 0) throw std::domain_error("divide by zero"); I guess this is personal preference. I got this idea from Design Patterns ([URL]http://www.amazon.com/exec/obidos/tg/detail/-/0201633612/102-9465371-[/URL] 5694567?v=glance) Ok, done. Oh, ok. Ok, changed. But then l is modified. Eg m / 2; // m is changed Cool, thanks very much for your help. I definately learned a lot. Regards, Darren [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
How is my code?
Top