How camera fit object to left half side of the screen(width and height)

Here are some functions to fit objects within a view using a few lines of trigonometry math:

You could tweak those functions to operate on half of the view instead of the full view.