I have this following problem:
$T=nP_1 + mP_2$
With $T$, $P_1$ and $P_2$ real numbers. I have access to those three values, but is it possible to determine $m$ and $n$ ? This looks like the Bézout identity but with real values instead of integers. So would it be a generalization? I also know that $m$ and $n$ are integers between $0$ and $8$.
For context, I am looking at the neighbors of a cell in an array, so 8 surrounding cells with 3 values possible and I want to retrive from the total sum of the values the linear combination of $P_1$ and $P_2$. So I don't have to use several loops and if statements slowing down my program.
Thanks in advance for your answer!