# Is it possible to solve for u and v, given the following matrix multiplication chain?

## I am attempting to determine the intersections between a parametric Bezier surface, and line $L = {P}_{0} + t V$, where $P$ is a point that lies on the line, and $V$ is a vector describing the line's direction. The following image's source presents a seemingly convenient matrix form. The equation in the image represents the calculation of a point that lies on the surface, given the parameters $u$ and $v$. I figured the next logical step would be to substitute $P \left(u , v\right)$ for the equation of the line given above, but I am unsure how to proceed. I have tried to isolate the $u$ and $v$ coefficient matrices, but to no avail. Is it possible to solve for $u$ and $v$? Are there any alternatives?

Dec 27, 2016

See below.

#### Explanation:

After matrix multiplication we obtain

$P \left(u , v\right) = \left(x \left(u , u\right) , y \left(u , v\right) , z \left(u , v\right)\right)$

The line is defined as

$L \to P = {P}_{0} + t V$

The intersections are obtained solving

$\left\{\begin{matrix}x \left(u v\right) = {P}_{0}^{x} + t {V}_{x} \\ y \left(u v\right) = {P}_{0}^{y} + t {V}_{y} \\ z \left(u v\right) = {P}_{0}^{z} + t {V}_{z}\end{matrix}\right.$

Three equations with three unknowns. The solutions can be obtained using an iterative procedure like Newton-Raphson.

${\xi}_{k + 1} = {\xi}_{k} - J {\left({\xi}_{k}\right)}^{- 1} g \left({\xi}_{k}\right)$

where

${\xi}_{k} = \left({u}_{k} , {v}_{k} , {t}_{k}\right)$
$g \left({\xi}_{k}\right) = \left(\begin{matrix}x \left({u}_{k} {v}_{k}\right) - {P}_{0}^{x} - {t}_{k} {V}_{x} \\ y \left({u}_{k} {v}_{k}\right) - {P}_{0}^{y} - {t}_{k} {V}_{y} \\ z \left({u}_{k} {v}_{k}\right) - {P}_{0}^{z} - {t}_{k} {V}_{z}\end{matrix}\right)$

J(xi_k)= (((partial x)/(partial u)(u_k,v_k),(partial x)/(partial v)(u_k,v_k),-V_x),((partial y)/(partial u)(u_k,v_k),(partial y)/(partial v)(u_k,v_k),-V_y),((partial z)/(partial u)(u_k,v_k),(partial z)/(partial v)(u_k,v_k),-V_z))

Calling now

$P \left(u , v\right) = {U}^{T} \cdot {C}^{T} \cdot \Pi \cdot C \cdot V$

where

$U = {\left(1 , u , {u}^{2} , {u}^{3}\right)}^{T}$
$V = {\left(1 , v , {v}^{2} , {v}^{3}\right)}^{T}$

we have

$\frac{\partial P}{\partial u} = {\left(\frac{\mathrm{dU}}{\mathrm{du}}\right)}^{T} \cdot {C}^{T} \cdot \Pi \cdot C \cdot V$
$\frac{\partial P}{\partial v} = {U}^{T} \cdot {C}^{T} \cdot \Pi \cdot C \cdot \frac{\mathrm{dV}}{\mathrm{dv}}$