I have two functions as follows:
$$a=\frac{5}{16}(x+2y)$$ $$b=-\frac{5}{16}(x-2y)$$
The user may enter any arbitrary number for (x, y). However only values which produce whole integers of a and b are considered valid. Given these conditions, is it possible to find the nearest valid (x, y) to the user's inputted x and y which would produce whole numbers for a and b.
I thought representing both equations as planes and finding the closest point on them to a specified point using Lagrange multiplication. But wasn't sure exactly how to do so, to produce the results I was looking for.
Edit: Follow-up question found here