The Cheat Sheet

Graphics

FoV Conversions

fx = atan( tan( 0.5 * fy ) * (w / h) ) * 2
fy = atan( tan( 0.5 * fx ) * (h / w) ) * 2

Audio

Gain and Attenuation

a = 20 * log10( g )
g = 10a/20

Where g is linear gain in the range of (0, 1] and a is attenuation in dB. Keep in mind that log( g ) approaches negative infinity as g approaches zero, so it makes sense to avoid computing the log for small values of gain and just return something like -96dB (which is pretty much silence). As a useful reference, a=-6dB for g=0.5, roughly.