Math tools for the PTZ camera project