This is some miscellaneous code I need when evaluating tablets.
Often we are presented with size information from a manufacturer like resolution and diagonal length.
For example the a pen display is specified as HD (1920x1080) with a diagonal length of 13.3". But we may not be given the physical height and width. This function calculates the height and width given the aspect ratio and the diagonal length.
In this case it would be called like this (this assumes the pixels are square):
Or if you know the aspect ratio is 16/9