I am currently working on a problem where I am trying to convert a 2-D coordinate system into a 3-D coordinate space that shares a common origin. Say in 3-D space, I have two known vectors, r1 and r2 that branch from the origin. These vectors form a plane that contains some point "P". Looking at all of these points along the 2-D plane, I have the 2-D position coordinates of the known vectors, and the 2-D position of point "P". Using this information, and assuming that these points do in fact line up, how can I find the 3-D coordinates of point "P"?
I know this is kind of a strange question, so here is an example I made (I intentionally made the vectors perpendicular since it is easier to work with, but they wont be for my problem)
3-D: Visual Representation of 3-D space
r1 = <1, 2, 1>
r2 = <2, 1, -4>
P = <?, ?, ?
2-D:Visual Representation of points in 2-D Plane
r1 = <2, sqrt(2)>
r2 = <sqrt(7), -sqrt(14)>
P = <1, 3>
I ended up figuring it out, it was actually fairly simple once I broke it down into a series of variables. I am going to post the answer here in case anyone else runs across a problem like this.
Essentially, the problem becomes a simple rotation matrix problem, where
R = [a, b, c ; d, e, f]
X = <x,y> (2-D)
V=<u,v,w> (3-D)
where RX=V.
This simply solves to be
a=(u1y2 - u2y1)/(x1y2-x2y1)
b=(u2x1 - u1x2)/(x1y2-x2y1)
c=(v1y2 - v2y1)/(x1y2-x2y1)
d=(v2x1 - v1x2)/(x1y2-x2y1)
e=(w1y2 - w2y1)/(x1y2-x2y1)
f=(w2x1 - w1x2)/(x1y2-x2y1)