Consider the following perspective-projection matrix which works (perfectly fine) with just vertical-field-of-view and aspect-ratio given by the caller:
func (me *Mat4) Perspective (fovY, aspect, near, far float64) {
tfY = near * math.Tan(fovY * math.Pi / 360)
tfX = tfY * aspect
me.Frustum(-tfX, tfX, -tfY, tfY, near, far)
}
How would one go about extending this function's body to support this: caller can now specify either vertical (fovY) or horizontal (fovX) field-of-view, but not both, and an aspect-ratio. How would this function be able to calculate the missing fovY from just the given aspect-ratio and fovX?