Do you know where you are? What planet did you come from? Do you come in peace?
I think in multi-axis machining terms, you are wanting to know how to keep the tool "normal" to the surface. I am not sure you need advanced algebra to get the needed vectors. The way a multi-axis machine works is you need the point on the part and the a axis and b axis angles, all in relation to an established X0, Y0, Z0 point and the corresponding planes.