Unfortunately tool path calculation for pocket clearance is not a simple equation, but complex optimization system consisting of many constraints. Basics involved are how the pocket surface is offset by the cutter such that you will be able to obtain the CLDATA for a simple 2D case. You may look at the following for simple pockets and for the mathematics involved.
Preiss, K., & Kaplansky, E. (1985). Automated part programming for CNC milling by artificial intelligence techniques. Journal of Manufacturing Systems,4(1), 51-63.
Satyanarayana, B., Rao, P. N., & Tewari, N. K. (1988). Machining of plate cam profiles on CNC machine tools using a highly integrated part programming system. The International Journal of Advanced Manufacturing Technology, 3(4), 105-125.
Satyanarayana, B., Rao, P. N., & Tewari, N. K. (1990). An interactive programming system for milling contours and pockets. The International Journal of Advanced Manufacturing Technology, 5(3), 188-213.
However, when complex geometries (3D profiles) more comprehensive strategies need to be followed. It is a computational geometry problem and the following are a few references which will guide you.
Held, M. (1991). On the computational geometry of pocket machining (Vol. 500). Springer.
Hatna, A., Grieve, R. J., & Broomhead, P. (1998). Automatic CNC milling of pockets: geometric and technological issues. Computer Integrated Manufacturing Systems, 11(4), 309-330.
Held, M., Lukács, G., & Andor, L. (1994). Pocket machining based on contour-parallel tool paths generated by means of proximity maps. Computer-Aided Design, 26(3), 189-203.
El-Mounayri, H., Kishawy, H., & Tandon, V. (2002). Optimized CNC end-milling: a practical approach. International Journal of Computer Integrated Manufacturing, 15(5), 453-470.
Vosniakos, G., & Papapanagiotou, P. (2000). Multiple tool path planning for NC machining of convex pockets without islands. Robotics and Computer-Integrated Manufacturing, 16(6), 425-435. (http://web.iitd.ac.in/~pvmrao/cnc/vosniakos.pdf)