You want to show something like this?

There's an exhaustive discussion of how to show math in html at
http://www.cs.tut.fi/~jkorpela/math/The webviewer component and html and javascript might do it.
A simpler approach would be take an image of pi, and
nest horizontal and vertical screen arrangements and labels
and images to build your two different conversion samples, like in
the format in the above picture.
If you want something less fancy but simpler to code, you could display
your equations in pure text:
(270/1) * (pi/180) = (27/1) * (pi/18) = (3/1) * (pi/2) = (3/2)*pi
You would have to keep your numerators and denominators in separate variables,
and simplify them in pairs by seeing if you can divide them both evenly by increasing factors
ranging from 2 up to the lesser of the two.
ABG