I would assume its just simple Matrix calculations. What language are you writing this in? Search for a Matrix library for your language of choice and read the docs for it.