Designing Geometric Algebras - Interpolating Points

Now for an application that makes use of the fact that we can represent arbitrary shapes as GA objects. Let's start with a concrete example. We have three points which are also shown in the figure below. We want to findyvalues for other values ofxbetween our three points. This is called interpolation forxbetween our known points, and extrapolation forxoutside of our known points. In other words, we want to find a curve that reasonably interpolates our points.
(1)(x1,y1)=(3,2)(x2,y2)=(0,3)(x3,y3)=(1,1)
Figure 1 - Blue: Points we want to interpolate.
Figure 1 - Blue: Points we want to interpolate.
A natural choice for a family of curves are polynomials inx, so we will focus on them for now but the procedure outlined in this article will work for any other family of curves too. It turns out thatNpoints unique determine the coefficients of a degreeN1polynomial. For our example,y=c0+c1x+c2x2is of degree two so its coefficients can be found given three points. The solution we want to find is shown below.
Figure 2 - Blue: Points we want to interpolate. Green: Second degree polynomial interpolating the points.
Figure 2 - Blue: Points we want to interpolate. Green: Second degree polynomial interpolating the points.
Representing polynomials in Geometric Algebra
In the first section we learnt that we can represent polynomials in Geometric Algebra by introducing a basis vector for each term of it, including theyterm. For our concrete example we would have four basis vectors corresponding to1,x,x2,yand the up function which maps(x,y)points to vectors in the 4D space is
(2)up(x,y)=1e0+xe1+x2e2+ye3
Finding the interpolating object
Now we can represent points. How do we get an object representing a curve that goes through all points? We know we can join points together to make shapes which go through all of them with the wedge product. In general we have the following equation which results in the pseudovectorp:
(3)p=n=1Nup(xn,yn)=n=0N1pnen
WhereNis the number of points. This should give us some object representing a shape that goes through all of the points that were joined.
Getting the interpolating polynomial coefficients from the object
We can examine this object by applying the Outer Product Null Space / Join Null Space equation:
(4)pup(x,y)=(p0e0+p1e1+p2e2+p3e3)(1e0+xe1+x2e2+ye3)==e0123(p0+p1x+p2x2+p3y)=0
To bring it into the usual form we still need to bringyon the other side with a coefficient of1. We can also get rid of the pseudoscalare1234. This results in
(5)y=p0p3p1p3xp2p3x2
So indeed our object represents a polynomial. In general, to get the ordinary coefficientscnfrompwe have
(6)cn=pnpN
We can see that the coefficients of the polynomial can be directly read off ofp's coefficients. This is all that we needed. We wedged together some points into a pseudovector, we know that the object goes through all of our points, and from the pseudovector's coefficients we can easily get the interpolating polynomial's coefficients.
For our concrete example we have the following pseudovector for representing the polynomial
(7)p=up(3,2)up(0,3)up(1,1)=36e017e17e212e3
Reading off the coefficients and dividing byy's coefficient yields the interpolating polynomial equation
(8)y=36121712x712x2=31712x712x2
which corresponds exactly to the green curve in the figure 2.

Algorithm Summary

To summarize the procedure, given N points(xn,yn)
  1. We want to interpolate with a polynomial of degreeN1with coefficientscn:y=n=0N1cnxn
  2. Use GA with N basis vectors and up function:up(x,y)=yeN+n=0N1xnen
  3. Build polynomial objectpby wedging together N up projected points:p=n=1Nup(xn,yn)
  4. Extract interpolating polynomial coefficientscnfromp:cn=pnpN

Conclusion

We started by looking at what interpolation is and we chose to use polynomials for interpolation. We then applied our knowledge from the previous section to represent polynomials in Geometric Algebra. With the wedge product we constructed an object representing the interpolating polynomial from which we could just read off the coefficients.
This process generalizes to any number of points and it uses only very simple GA operations, so it might be preferable over the usual methods like using matrices or Lagrange polynomials. While we were focusing on polynomials here, this process works identically with other functions too, as no assumptions about the basis functions were made. The only change is to use a different up function.

Next: Design of Geometric Algebras - Tangent Objects

Bonus: Different basis functions

Below I tried some different basis functions for the same three points and five points.
Three points
up(x,y)=e0+xe1+x2e2+ye3
up(x,y)=e0+sin(x)e1+cos(x)e2+ye3
up(x,y)=e0+sin(x)e1+sin(2x)e2+ye3
up(x,y)=e0+2xe1+3xe2+ye3
up(x,y)=sin(y)e0+sin(x)e1+cos(x)e2+sin(xy)e3
Five points
up(x,y)=e0+xe1+x2e2+x3e3+x4e4+ye5
up(x,y)=e0+sin(x)e1+cos(x)e2+sin(2x)e3+cos(2x)e4+ye5
up(x,y)=e0+sin(x)e1+sin(2x)e2+sin(3x)e3+sin(4x)e4+ye5
up(x,y)=e0+2xe1+3xe2+4xe3+5xe4+ye5
up(x,y)=xe0+sin(x)e1+cos(x)e2+sin(y)e3+cos(y)e4+ye5