I come across some weird behavior, though, when the x and y coordinates of the grid points have different scales.
I wonder if this could be easily fixed by having a normalization step before constructing the interpolant, which would scale the given points to an e.g. unit box (then, when the interpolant is called, the coordinates used for the new interpolated data can be transformed with the same normalization)?
An example of the current problem below, and let me know if I've missed something obvious in the docs that solves this 😅
using NaturalNeighbours
using CairoMakie
N = 50
f = (xy) -> sinc(sqrt((xy[1])^2 + (xy[2] * N)^2) .+ 0.1 * randn())
x = Float64.(-6:0.1:6)
y = Float64.((-6:0.1:6) ./ N)
xy = Iterators.product(x, y)
z = f.(xy)
itp = interpolate(first.(xy)[:], last.(xy)[:], z[:])
_x = range(-6, 6, length=100)
_y = range(-6 / N, 6 / N, length=100)
_xy = Iterators.product(_x, _y)
_z = itp(first.(_xy)[:], last.(_xy)[:])
Z = reshape(_z, length.([_x, _y])...)
f = Figure(size=(600, 300))
ax = Axis(f[1, 1]; title="Input")
p = heatmap!(ax, x, y, z)
ax1 = Axis(f[1, 2]; title="Output")
heatmap!(ax1, _x, _y, Z)
display(f)