Bantu debug kenapa dot_product ga bisa nol.....
int _tmain(int argc, _TCHAR* argv[])
{
double Bux = 1.444, Buy =2.3232, Buz =3.23232;
double bvx = -1.543, bvy = -2.5343, bvz = -3.5343;
double Bvx,Bvy,Bvz;
if((Bux*bvx+Buy*bvy+Buz*bvz)==0)
{
Bvx = bvx; Bvy = bvy; Bvz = bvz;
}
else
{
double k = -1 * (Bux*bvx+Buy*bvy+Buz*bvz) / (pow(Bux,2)+pow(Buy,2)+pow(Buz,2));
Bvx = (k*Bux)+bvx;
Bvy = (k*Buy)+bvy;
Bvz = (k*Buz)+bvz;
double dot_product = Bux*Bvx+Buy*Bvy+Buz*Bvz;
double g =3;
}
return 0;
}