Finite straight line question, will this formula create a straight line between two end points
This is absurdly complicated. The simple way would be to write: $$y=1,\quad -3<x<3.$$
But if your goal is just to find a function that implies the domain rather than explicitly writing out $-3<x<3$, then you could do something like $$y = \frac{\sqrt{9-x^2}}{\sqrt{9-x^2}},$$ which is much simpler than what you have.