Exemplo n.º 1
0
/**
 * Computes dot product.
 *
 * @param u
 * @param v
 * @return
 */
double Vector4::DotProduct(Vector4 &u, Vector4 &v){
	u.Homogenize();
	v.Homogenize();

	double product = 0.0;

	double a1 = u.getX();
	double a2 = u.getY();
	double a3 = u.getZ();

	double b1 = v.getX();
	double b2 = v.getY();
	double b3 = v.getZ();

	product = a1*b1 + a2*b2 + a3*b3;
	return product;
}
Exemplo n.º 2
0
/**
 * Computes dot product.
 *
 * @param u
 * @param v
 * @return
 */
float Vector4::DotProduct(Vector4 &u, Vector4 &v){
	u.Homogenize();
	v.Homogenize();

	float product = 0.0;

	float a1 = u.getX();
	float a2 = u.getY();
	float a3 = u.getZ();

	float b1 = v.getX();
	float b2 = v.getY();
	float b3 = v.getZ();

	product = a1*b1 + a2*b2 + a3*b3;
	return product;
}