Skip to content
Snippets Groups Projects
Commit 02c717b5 authored by RicardoEA's avatar RicardoEA
Browse files

Corrijo implementación de funciones matemáticas

parent 4580534e
No related branches found
No related tags found
No related merge requests found
......@@ -54,18 +54,24 @@ float dotProduct (sF3dVector_t* v, sF3dVector_t v2){
}
void crossProduct (sF3dVector_t* v, sF3dVector_t v2){
v->x = v->y*v2.z - v->z*v2.y;
v->y = v->z*v2.x - v->x*v2.z;
v->z = v->x*v2.y - v->y*v2.x;
float vx, vy, vz;
vx = v->x;
vy = v->y;
vz = v->z;
v->x = vy*v2.z - vz*v2.y;
v->y = vz*v2.x - vx*v2.z;
v->z = vx*v2.y - vy*v2.x;
}
void vector_mul (sF3dMatrix_t m, sF3dVector_t* v){
v->x = m.x1*v->x + m.y1*v->y + m.z1*v->z;
v->y = m.x2*v->x + m.y2*v->y + m.z2*v->z;
v->z = m.x3*v->x + m.y3*v->y + m.z3*v->z;
float vx, vy, vz;
vx = v->x;
vy = v->y;
vz = v->z;
v->x = m.x1*vx + m.y1*vy + m.z1*vz;
v->y = m.x2*vx + m.y2*vy + m.z2*vz;
v->z = m.x3*vx + m.y3*vy + m.z3*vz;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment