cam tracking programming but stuck

Hey, to all the math whizz and python coders.

I’m working on a python cam tracker and already have the code working.
Basically i’ve coded the cam solving part of the tracker that takes tracks in screen coordinates and solves the cam loc-rot- i don’t have anything to actually track the footage and create the 2d trackers but i’m running it on a vertice cloud in blender- the part that is working solves the cam local z movement-foward and back- however, i’m stuck on how to mathematically tell the difference between cam panning and rot such as tilt and roll.

Anyone have some knowledge?