Field of View calculations

This is a simple node for doing camera calculations. I guess I could make it into a python pane

Getting field of view given horizontal ap and focal length: 2 * atan(hap / (2 * focal)) * 180 / pi

Getting focal length given horizontal ap and field of view: (hap / (2 * tan(pi * fov2 / 360)))

Here is a noop with this stuff plugged in:

NoOp {
 name CameraCalculator
 selected true
 xpos -2240
 ypos 540
 addUserKnob {20 FocalFOV l "Calculate this!"}
 addUserKnob {26 divin l Inputs}
 addUserKnob {26 "" +STARTLINE}
 addUserKnob {7 focal l "Focal Length" R 0 180}
 focal 35
 addUserKnob {7 fov2 l "Field of View" R 0 360}
 fov2 90
 addUserKnob {7 hap l "Horiz Ap" R 0 36}
 hap 23.75
 addUserKnob {26 "" +STARTLINE}
 addUserKnob {26 divout l Outputs}
 addUserKnob {7 fov l "Resulting FOV"}
 fov {{"2 * atan(hap / (2 * focal)) * 180 / pi"}}
 addUserKnob {7 focal2 l "Resulting Focal Length" R 0 180}
 focal2 {{"(hap / (2 * tan(pi * fov2 / 360)))"}}
 addUserKnob {7 diag l INVISIBLE +INVISIBLE}
 diag {{sqrt(hap*hap+vap*vap-2*hap*vap*cos(90))}}
}