On 22/11/2013 at 11:36, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 13
Platform: Windows ;
Language(s) : C++ ;
---------
I'm getting very strange values out of the Dot() SDK function.
According to the internet. My hand calculated results are correct. And the result from Dot() is not.
What's going on with this function?
Example #1
LVector a = (2, 3, 4);
LVector b = (1,-2, 3);
/* Calculating the dot product myself by hand
2*1 + 3*-2 + 4*3
2 + -6 \+ 12
8 <--The answer
*/
LReal dot = Dot(a,b); //<---returns 36! why?
GePrint(RealToString(dot));
Example #2
LVector a2 = (4, 8, 10);
LVector b2 = (9, 2, 7);
/* Calculating the dot product myself by hand
4*9 + 8*2 + 10*7
36 \+ 16 + 70
122 <--The answer
*/
LReal dot2 = Dot(a2,b2); //<---returns 210! why?
GePrint(RealToString(dot2));
-ScottA