Some time ago I implemented a trackball without trigonometry, and later I modified it to also use rational numbers.
Lately javascript added native support for arbitrary large integers. I wondered if I could use them to implement the trackball more efficiently.
Here it is (only tested on chrome, which supports javascript bigints):
The largest integer used is