FrustumSizeAtDistance error

var frustumHeight = 2.0 * distance * Mathf.Tan(camera.fieldOfView * 0.5 * Mathf.Deg2Rad);

error CS1502: The best overloaded method match for `UnityEngine.Mathf.Tan(float)’ has some invalid arguments

I tried all this with converting to float also but I dont know what todo?

You have to provide float, not double

var frustumHeight = 2.0f * distance * Mathf.Tan(camera.fieldOfView * 0.5f * Mathf.Deg2Rad);

Floats are represented with small f at the end, like 2.0f

Hope it helps!