Based on this article by Lawrence Turner (thanks to Piergiorgio Odifreddi):
http://turner.faculty.swau.edu/mathematics/materialslibrary/roman/

Javascript implementation by Francesco Sblendorio
Download and enjoy the source code!