예제 #1
0
float dotproduct(const vector3d &a, const vector3d &b)
{
	return a.getx()*b.getx() + a.gety()*b.gety() + a.getz()+b.getz();
}
예제 #2
0
vector3d crossproduct(const vector3d &a, const vector3d &b)
{
	return vector3d(a.gety()*b.getz() - a.getz()*b.gety(),
					a.getz()*b.getx() - a.getx()*b.getz(),
					a.getx()*b.gety() - a.gety()*b.getx());
}