For those who need a quick way to do this I posted my implementation.

http://www.novalab.org/mach3/QCT.htm

Regards,

Chris