示例#1
0
int vector_dot_product (vector_t* v1, vector_t* v2) {
	//return (v1->x * v2->x + v1->y * v2->y + v1->z * v2->z);
	return mulfx(v1->x, v2->x) + mulfx(v1->y, v2->y) + mulfx(v1->z, v2->z);
}
示例#2
0
int vector_cross_product_z (vector_t* v1, vector_t* v2) {
	//return ((v1->x * v2->y) - (v1->y * v2->x));
	return mulfx(v1->x, v2->y) - mulfx(v1->y, v2->x);
}
示例#3
0
void vector_scalar(vector_t *v, int s, vector_t* r) {
	r->x = mulfx(v->x, s);
	r->y = mulfx(v->y, s);
	r->z = mulfx(v->z, s);
}