I was searching to find how to make the camera fit a game object and I found this answer:
Change the size of camera to fit a GameObject in Unity/C# , and I don't understand this part
cam.orthographicSize = ((w > h * cam.aspect) ? (float)w / (float)cam.pixelWidth * cam.pixelHeight : h) / 2;
I want to understand how that part of the code works.