Reversing equation

BlitzMax Forums/BlitzMax Programming/Reversing equation

I have this:

XPos+(30*CountX)-(CountY*30), YPos+(15*CountY)+(CountX*15)


the first part works out the X and the second part works out the Y coordinate. But how would i reverse the equation to work out the CountX/Y values if i have an X and a Y cooridinate. I'm having trouble because in order to work out what the CountX value is i need to know the CountY and vice-versa.

I have been working on this a week now and it is really starting to trouble me. Is this possible at all?

Thanks
Matt