Some references for how this can be accomplished in general: - https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.461.1828&rep=rep1&type=pdf - https://digitalscholarship.unlv.edu/cgi/viewcontent.cgi?article=3385&context=rtds - https://sites.google.com/site/turningfunctions/