Field of view

Hi guys, I’m trying to find a good way of adding a dynamic field of view to the rotation of my camera.

So the more the camera rotates in the Y axis the more field of view I get. Any ideas? Whatever I do I can’t get a smooth result.

Keep in mind that I’m a novice in Java scripting and are trying to learn:)

Thanks

camera.fieldOfView = transform.rotation.y;

?