Math and C++ [SOLVED]

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
Benjamin100
ES Beta Backer
ES Beta Backer
Posts: 250
Joined: Tue Jul 19, 2011 9:37 pm

Math and C++ [SOLVED]

Post by Benjamin100 »

Well, I'm back after a long break from programming to get back into it again.
This time I've decided to stick to learning some more basics before trying to make any sort of complicated 3d program.

For me this means some math.
I'm using a math related book, and right now I am reading about the dot product. What is the dot product actually used for? Maybe I've used it before and I just didn't call it that. What sort of situation would require calculating the dot product?
Last edited by Benjamin100 on Sun Nov 03, 2013 11:26 am, edited 1 time in total.
qpHalcy0n
Respected Programmer
Respected Programmer
Posts: 387
Joined: Fri Dec 19, 2008 3:33 pm
Location: Dallas
Contact:

Re: Math and C++

Post by qpHalcy0n »

Most handily, it tells you something about the degree of "parallelity" (that word is an invention) between two vectors.

If a and b are vectors then if:

a*b = 0 , the vectors are orthogonal

if a*b = |a||b| then they are parallel and coincident in direction. If the dot product is negative but of the same magnitude, they are parallel and 180 degrees separated. If they are unit vectors (length of 1), then this product will be 1 or -1.

a*b = |a||b|cos(angle-btw-a-and-b)

Used in projections. IE: projecting a vector onto an arbitrary plane or line. Vector-resolution.

Used all over linear algebra in Gram-Schmidt, least squares, SVD, and all sorts of compression algorithms. Critical to understanding any form of data compression or reconstruction.
Benjamin100
ES Beta Backer
ES Beta Backer
Posts: 250
Joined: Tue Jul 19, 2011 9:37 pm

Re: Math and C++

Post by Benjamin100 »

Thanks.
I guess I'll just have to wait until a time when it clearly needs to be used.
I like getting back to programming. Making some math functions now.
Post Reply