How to use C++ set the camera field of view?

I have a cube, specifically, a plane. I set the thickness very small.
I want to set the camera’s field of view to this plane. When I set the plane size(x,z) of level, the camera’s field of view also changes accordingly. This means that the camera’s field of view is the size (position) of the plane, or that the plane fills the camera’s field of view. This is similar to the opposite operation of assigning the camera’s field of view to Texture 2D.
In the Unity engine, the camera’s field of view is a plane.


So I can write a script to set the camera’s field of view to flat, but I don’t know how to implement it in Unreal.
How should I set it up?
I discovered cameras have two variables:
Sensor Width
Sensor Height
I don’t know if there is a correlation between two variables.
I hope you can give me some good algorithms and suggestions. Thank you very much.