Moving math related code to maths, and adding a 2d barycentric interpolator.