# anyone familiar with vector math?

Discussion in 'Archived Threads 2001-2004' started by felix_suwarno, Sep 13, 2002.

1. ### felix_suwarno Screenwriter

Joined:
Dec 2, 2001
Messages:
1,523
0
Trophy Points:
0
my prof wants me to write these methods :

vector operator*(double d, const vector& v)
{
// Calculate d * v
}

vector operator*(const vector& v, double d)
{
// calculate v * d
}

v would be vector with x,y and z components.

my question is, what is the difference between d times vector and vector times d?

i have consulted my calculus book and didnt find anything to answer this question. the book is "calculus" by james stewart. it only explains about multiplying vector with scalar, basically c times vector -> c times (x,y,z) equal to (cx, cy, cz).

2. ### James Gumbart Stunt Coordinator

Joined:
Feb 7, 2002
Messages:
71
0
Trophy Points:
0
There is no difference provided d is merely a number (scalar) which it appears to be.

However when d takes the form of a more complicated operator (matrix, derivative, etc.) then it becomes important.

No idea why he's making you write two methods though.

3. ### felix_suwarno Screenwriter

Joined:
Dec 2, 2001
Messages:
1,523
0
Trophy Points:
0
thanks james. that is very helpful.

Joined:
May 17, 1999
Messages:
2,358