bracket function

bracket bounds a value on the x-axis and y-axis