Hi all,

I'm currently trying to write an equation or piece of logic which will allow me to test ratios against the Golden Ratio to find the closest match. The ratios I need to test range from 1:255 to 255:1 (to several decimal places) and I want to convert these ratios into a decimal (z) between 0 & 1, such that 0 is a perfect match (1:1.618) and 1 is a the furthest possible (255:1). All the z values should be positive, such that a ratio of 10:1 will return a result similar to 1:11.

The application of this is in testing whether the brightness of two parts of an image conform to the Golden Ratio. In practice most of the ratios will be much closer, say between 5:1 and 1:5, so it might suit a log(10) solution?

So, where x = left side of ratio and y = right side, how do I define z as this number between 0 & 1?

This is keeping me up at night!

Also mods, please move this thread if I'm in the wrong place.

Thanks,

Pietbot