0

Suppose I have a quadrilateral ABCD in 3D space

A----------B \ \ \ \ \ \ C----------D

And two-dimensional coordinates (x,y), how can I "map" these coordinates onto ABCD to get 3D coordinates of the point on the quadrilateral.

For example, assuming that AC = 2, CD = 4,

  • (0,0) => A because A is the top-left
  • (4,2) => D because D is the bottom-right
  • (2,1) => The center of the quadrilateral on all axes

This question on Stack Overflow is more or less the exact opposite of what I want to do.

Jacob Garby
  • 115
  • 4
  • The quadrilateral could be anywhere in 3-space. When you say "plane" it appears you mean "quadrilateral." In the typical coordinate system used in math if $A=(0,0),$ the $D=(4,-2),$ not $(4,2).$ You could simply put a $z-$ coordinate of $0$ on each point to get a quadrilateral in 3-space. – saulspatz Mar 17 '18 at 17:51
  • You're right, I do mean quadrilateral. But i'm not sure what you mean by the rest of that – Jacob Garby Mar 17 '18 at 17:53
  • Suppose you have coordinates in the $xy-$plane. You can embed the figure in 3-space simply by changing each coordinate $(x,y)$ to $(x,y,0).$ The coordinates of A would become $(0,0,0)$ Those of D would become $(4,2,0).$ There are infinitely many other ways to do it, which is what I meant by saying that the quadrilateral could be anywhere in 3-space. As to your not using the coordinate system that's usual in math, are you perhaps doing computer graphics? In computer graphics, it's usual to have $(0,0)$ at the top left and have the $y-$coordinate increase as you move down, but not in math. – saulspatz Mar 17 '18 at 18:30

1 Answers1

0

You need the 3-D coordinates of the point that corresponds to $A$ and unit vectors $\vec u$ and $\vec v$ that point in the directions of the edges $\overline{AB}$ and $\overline{AC}$, respectively, i.e., $$\vec u = {B-A\over \|B-A\|} \\ \vec v = {C-A\over\|C-A\|}.$$ The mapping you seek is then $(x,y)\mapsto A+x\vec u+y\vec v$. This is one of the simplest examples of a parametric surface patch. It’s often more convenient to set $\vec u=B-A$ and $\vec v=C-A$ so that the patch coordinates all lie in the interval $[0,1]$.

amd
  • 55,082