I've been screwing around with C++ lately and learning how to program. For my first program I made a little DIN calculator. I still don't really know how to program but this should work. This is exactly the same as using the chart below.
If you have a few seconds you can download it from the sight above, just click download under the Din Calculator side. It's not pretty, but it works... I think. Compare it to the chart below and tell if it works or not.