I'm trying to parametrize the quad with an x and y coordinate (from 0 to 1) so that I can properly apply a texture to it for a computer graphics application. I came up with the idea for this myself, but am having a hard time getting to a solution.
Given the 2d vectors $A$, $B$, $C$, $D$, $P$,
construct points $R$ = $A$x+$B$(1-x) and $Q$ = $C$x+$D$(1-x)
then $P$ = $R$y+$Q$(1-y)
substitute R and Q so $P$ = ($A$x+$B$(1-x))y + ($C$x+$D$(1-x))(1-y)
since coords are 2d, this is actually two equations (lowercase=x uppercase=y)
$p$ = ($a$x+$b$(1-x))y + ($c$x+$d$(1-x))(1-y)
$P$ = ($A$x+$B$(1-x))y + ($C$x+$D$(1-x))(1-y)
take first equation and solve for y
$y = \frac{-cx+d(x-1)+p}{x(a-c)+b(1-x)+d(x-1)}$
substitute y in second equation
$P = (Ax+B(1-x))\frac{-cx+d(x-1)+p}{(x(a-c)+b(1-x)+d(x-1)}+(Cx+D(1-x))(1-(\frac{-cx+d(x-1)+p}{x(a-c)+b(1-x)+d(x-1)}))$
solve for x? I think that would be it, I'm just stuck on how to do this. Its too large and unwieldy. Is there another way?


Give all vectors a third coordinate of $0$ so that, as members of $\Bbb{R}^3$, they're compatible with cross products. Also, translate all points by $-P$ to move $P$ to the origin. Then, for $P$, $Q$, $R$ to be collinear, "all we have to do" is force $$R\times Q = O \tag{0}$$ where $O:=(0,0,0)$. To simplify some calculations, let's re-parameterize relative to the midpoints of $\overline{AB}$ and $\overline{CD}$ by defining $s := 2x-1$. Then we have $$R = \frac12(A+B)+ \frac12(A-B)s \qquad\qquad Q = \frac12(C+D)+\frac12(C-D)s$$ and $(0)$ becomes (after multiplying-through by $4$), $$s^2 ((A-B)\times(C-D)) \;+\; 2 s (A\times C-B\times D) \;+\;((A+B)\times(C+D)) \;=\; O \tag1$$
Since $A$, $B$, $C$, $D$ are all in $\Bbb{R}^2$, the first two components of any cross product are $0$. Thus, $(1)$ amounts to a quadratic in $s$ whose coefficients are the third components of those cross-products. Solving via the Quadratic Formula, we find $$s = -\frac{(A\times C -B\times D)_3\pm \sqrt{\Delta}}{((A-B)\times(C-D))_3} \qquad\qquad\left(\;x = \frac12(1+s)\;\right)\tag2$$ where $$\begin{align} \Delta &:=(A\times C - B\times D)_3^2 - ((A-B)\times(C-D))_3 ((A+B)\times(C+D))_3 \\[4pt] &\;=(A\times D)_3^2 + (B\times C)_3^2 - 2 \left(\, (A\times B)_3\,(C\times D)_3 + (A\times C)_3\,(B\times D)_3 \,\right) \end{align}$$ (The second form will show invariance under a substitution below.)
Now, to find $y$ first observe that $$\begin{align} Ry+Q(1-y) &= (Ax+B(1-x)) y + (C x+D(1-x))(1-y) \\ &=(Ay + C(1-y))x+ (B y+D(1-y))(1-x) \\ &=R' x + Q'(1-x) \end{align}$$ where $R' := Ay+C(1-y)$ and $Q':=By+D(1-y)$. Thus, we can find $y$ by the process above, which gives a counterpart of $(2)$ with the substitutions $A\to A$, $B\leftrightarrow C$, $D\to D$ (leaving $\Delta$ unchanged, as promised): $$t = -\frac{(A\times B -C\times D)_3\mp \sqrt{\Delta}}{((A-C)\times(B-D))_3} \qquad\qquad\left(\;y = \frac12(1+t)\;\right)\tag3$$ Note that the sign on $\sqrt{\Delta}$ flips from its state in $(2)$ to get the proper correspondence between the solutions for $s$ and $t$. $\square$
For an example, consider $$A = (1,2,0) \qquad B = (3,4,0) \qquad C = (-1,-1,0) \qquad D = (-2,-3,0) \qquad P=(0,0,0)$$ Then, writing $\lambda$ for $\pm 1$, we (and by "we", I mean "Mathematica") can calculate $$\Delta = 8 \qquad s = 1+\lambda\sqrt{2} \qquad t = -3-2\lambda\sqrt{2} $$ $$x = \frac12 (2 +\lambda \sqrt{2}) \qquad y = -1-\lambda\sqrt{2}$$ so that $$\begin{align} R &= Ax+B(1-x) = (1 - \lambda \sqrt{2}, 2 - \lambda \sqrt{2}, 0) \\ Q &= Cx+D(1-x) = \left(\frac12 (-2 + \lambda \sqrt{2}), -1 + \lambda \sqrt{2}, 0\right) \end{align}$$ and $$Ry+Q(1-y) = (3 (\lambda^2-1), 4 (\lambda^2-1), 0) = (0,0,0) = P$$ as desired.