I have measured points on a two dimensional square lattice.
.
How can I fit the data to a square lattice? I guess some methods like curve fitting or least square approximation would work, but I couldn't find any literature for the same problem.
- the lattice has discrete points
- the lattice is modeled with multiple parameters: translation (
x0andy0), rotation (θ), lattice spacing (d), and it cannot be represented asy=f(x; a,b,...)form.
TLDR; not possible (without punishment for fine lattices)
So I had the same question and I researched why it isn't possible. I show that for every
nrational points,x1, ... , xnthere exists some rationalq, bsuch that for everyithere exists an integerzsuch thatxi = z * q + b.Proof by induction:
base case:
We start at
n=2, for that, chooseq = x1 - x0andb = x0assumption:
let there be
x1, ..., xn+1rational points. Then for the firstnpoints, there exists some rationalq, bsuch that for everyi<=nthere exists an integerzsuch thatxi = z * q + binductive step:
take
q, bfrom the assumption. We find a natural number beta such thatq' := q / s, bsatisfies the assumption fori<=n+1.Indeed, for every natural number and
i<=n, whenxi = z * q + b, then alsoxi = z * s * q' + bNow we have to choose a natural
s, such thatx := xn+1 = z * q' + bfor an integerz.I will derive
sand it will also be a proof that such asexists. Definebetathroughx = beta * q + b. Because every number exceptbetais rational, so isbeta:beta = u / vdefine
s := vThen it holds:
x = beta * q + b = u / v * q + b = u / v * s * q' + b = u * q' + bwhereuis an integer.Empirical Proof
using the formulas from the proof, I made a python program that finds for arbitrary fractions the perfect lattice:
keep in mind this also holds for multiple dimensions of the space (they are independent) and also for multiple dimensions of the lattice (just set the other vectors to zero)