I have this formula:
Position in an array = $x + y$ * Self.width + layer * Self.width * Self.height
If I know the position how can I find $x$ based on the position only with this formula?
How to find $x$?
I have this formula:
Position in an array = $x + y$ * Self.width + layer * Self.width * Self.height
If I know the position how can I find $x$ based on the position only with this formula?
How to find $x$?
$$x = \text{Position in an array}\, - \text{Self.width}\,\times\,(y + \,\text{layer}\,\times \,\text{Self.height}) \, $$
You'd have $x$ as a function of $y$.
You could also express $y$ as a function of $x$. In both cases, you'd have the equation of a line, but you would need to know one the value of one variable, either $x, y$, to solve for the other.