project 3d into 3d (broken?)

This commit is contained in:
Trammell Hudson 2015-05-03 15:12:01 -04:00
parent 58de31c6cb
commit 20c000492f
2 changed files with 30 additions and 0 deletions

View File

@ -468,3 +468,27 @@ refframe_inset(
*x_out = *y_out = 0;
fprintf(stderr, "inset failed 2\n");
}
v3_t
refframe_project(
const refframe_t * const ref,
const v3_t p
)
{
v3_t o = { 0, 0, 0 };
o.p[0] = 0
+ ref->x.p[0] * p.p[0]
+ ref->y.p[0] * p.p[1]
+ ref->x.p[0] * p.p[2];
o.p[1] = 0
+ ref->x.p[1] * p.p[0]
+ ref->y.p[1] * p.p[1]
+ ref->z.p[1] * p.p[2];
o.p[2] = 0
+ ref->x.p[2] * p.p[0]
+ ref->y.p[2] * p.p[1]
+ ref->z.p[2] * p.p[2];
return o;
}

View File

@ -102,5 +102,11 @@ v3_project(
double * const y_out
);
/** Project a point in a reference frame back into 3D */
v3_t
refframe_project(
const refframe_t * const ref,
const v3_t p
);
#endif