Trying to isolate X in this formula

43 Views Asked by At

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$?

1

There are 1 best solutions below

0
On

$$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.