>[!tip]
> This entire page basically describes [[../Math/Barycentric Coordinates|Barycentric Coordinates]] but for [[Rectangle|Rectangles]]
To [[Interpolate|Interpolation]] a value at position $I$ within a [[Rectangle]] $\square ABCD$ with each point having some value $\kappa_{x}$ that we are trying to interpolate between.
Assuming in $\square ABCD$, $A$ is in the bottom left of the [[Cartesion Plane]] and the following points $B,\, C,\, D$ are placed in [[Counter-Clockwise]] positions around the center of the rectangle,
Let $s$ be the [[Distance]] between $I$ and $\overline{AD}$.
Let $t$ be the [[Distance]] between $I$ and $\overline{AB}$.
$\huge
\begin{align}
P&=\op{lerp}\pa{A, B, s}\\
Q&=\op{lerp}\pa{D, C, s}\\
I &= \op{lerp}\pa{P, Q, t}\\
\\
P &= A +(B-A)s \\
Q &= D + (C-D)s \\
I &=P + (Q-P)t \\
&=
A+(B-A)s
+
t\pa{
D+(C-D)s
- A-(B-A)s}
\\
&\cdots\\
I &= (1-s)(1-t) A + s(1-t) B
+ st C + (1-s)t D \\
&=\lambda A + \mu B + \nu C + \zeta D \\
&= \ba{\lambda , \mu, \nu, \zeta}_{\square ABCD}
\end{align}
$
$\huge \begin{align}
\lambda &= (1-s)(1-t) \\
\mu &= s(1-t)\\
\nu &= st\\
\zeta &= (1-s)t\\
\end{align} $
$\huge \begin{align}
\mathcal{C}_{\square ABCD \to S} &= \mat{
A & B & C & D
}
\end{align}$
>[!tip]
> $\lambda, \mu, \nu, \zeta$ are the normalised areas of each quadrant formed by placing I within $\square ABCD$
> $\huge \lambda+\mu+\nu+\zeta = 1 $