Blender 2.8 (Python) - manipulating the camera for resized objects In python, is there a method or function for adjusting the camera's parameters so that it covers a specific area, rather than just pointing at a specific point?

This would be handled by zooming in or out, but to what degree?

The following is one way to handle it, but not the only way - if there are other ideas I would appreciate the opportunity to learn about them.

Let's assume that I want the camera to point at (X,Y,Z).

I also want the camera's perspective to meet the following requirements:
(a) left edge includes point (X-2,Y,Z)
(b) right edge includes point (X+2,Y,Z)
(c) top edge includes point (X,Y+2,Z)
(d) bottom edge includes point (X,Y-2,Z)

As an illustration, I would pass the desired points to the function, which would position the camera in such a way that the points fall on the edges of the camera view as follows:



The above would not only aim the camera correctly, but would insure that all of the important elements of the scene are included.

Thanks in advance!
So basically you want to have a plane or area that should be included in camera view? 

There are few way to include different area size: 


Actually move camera to get a better cover of view. 
Adjust the camera sensor size directly. 
Adjust FOV setting for wider view. 


For the first one: view_selected is already include in Blender.

My naive solution is to actually create a mesh indicated your desired area and select it, view_selected it and move camera to here. But the size of the render view might cut up some places since the view won't be entire include in camera. So the things get more complicate if using existed function. Then writing some math function will be faster for sure.

You only need to calculate those coordinates from your points, using camera view coordinate system. Then other thing should be easily done