r = w/h = tan(H/2) / tan(V/2)
H = 2artan(tanV/2) * w/h)
V = 2artan(tan(H/2) * h/w)
https://themetalmuncher.github.io/fov-calc/
function calc()
{
var width = document.getElementById("hres").value;
var height = document.getElementById("vres").value;
var hfovRad = document.getElementById("hfov").value * Math.PI / 180;
var vfovRad = 2*Math.atan(Math.tan(hfovRad/2)*height/width);