Rex Rat --
I'm "up to my eyeballs" in a special project, and Excel and my computer had an argument yesterday and still haven't patched up their differences. So I'm not going to be able to explain, in detail and with real numbers, how to do this job. But, I can try to map out a path for you to take.
First, let's assume that when your Tilt Angle and Rotary Table Angle are both zero, the Tilt Axis is parallel to the Y(Machine), and the Rotable Table axis is parallel to the Z(Machine), and the workpiece is mounted on the Rotary Table so that the workpiece axis system is precisely parallel with the Machine axis system.
Now for some arithmetic. The four in-workpiece-plane points you provide Cartesian coordinates for are at the corners of an approximate rectangle. We need to determine how their plane is oriented, and that orientation needs to be described in terms of a Direction (in mathematical jargon, a Direction is commonly described as "A vector of undefined magnitude".), in the workpiece coordinate reference frame. Being neither a machine programmer nor a CAD jockey, I would first define Vector X', which begins at one of the four known points, and ends at the known point diagonally opposite the first point, in the rectangle formed by the four known points. Then I would define Vector Y', which begins at one of the two remaining known points, and ends at the forth known point.
The notation I'd use would start this way: Point 1 known location in workpiece coordinates is (x1, y1, z1), Point 2 known location in workpiece coordinates is (x2, y2, z2), and so on.
Vector X' would be (P3 to P1) = (x1-x3, y1-y3, z1-z3), and Vector Y' would be (P2 to P4) = (x4-x2, y4-y2, z4-z2).
Next, calculate the Cross Product of Vector X' x Vector Y'. The result will be a Vector that is perpendicular to both Vectors X' and Y', and is therefore perpendicular to the plane to which the workpiece is to be cut.
The Cross Product Vector, like the X' and Y' Vectors, will be a Cartesian (x,y,z) triple in the workpiece reference frame, and has both a Direction and Magnitude. It needs to be analytically adjusted to force its Magnitude to 1, making it a Unit Vector. You will need to calculate the Magnitude of the Cross Product Vector as the square root of the squares of the x, y, and z components . . . in other words, squareroot (x times x + y times y + z times z). The x of the Perpendicular Unit Vector will be the x of the Cross Product Vector divided by the Magnitude of the Cross Product Vector, the y of the Perpendicular Unit Vector will be the y of the Cross Product Vector divided by the Magnitude of the Cross Product Vector, and the z of the Perpendicular Unit Vector will be the z of the Cross Product Vector divided by the Magnitude of the Cross Product Vector.
There is one little problem . . . we don't know if the Perpendicular Unit Vector is the PUV going into the workpiece, or thePUV coming out of the workpiece. So we need to develop a second, polar opposite, Perpendicular Unit Vector, by simply inverting the sign of the original Perpendicular Unit Vector's x, y, and z components.
At this point, it's worth verifying that the two Perpendicular Unit Vectors have Magnitudes of 1.000000. If they don't, go back and check all your arithmetic to find your error or errors.
Now you should project the two Perpendicular Unit Vectors onto the workpiece X,Y plane. Take the ArcTangent of the PUV y component divided by the PUV X component -- if your Excel is working, the magic function and syntax is "=Atan2(value-of-PUV-x-component,value-of-PUV-y-component)*180/pi()" to provide the answer in decimally-divided degrees. If you're using a calculator, you'll have to keep track of the signs of the components to keep the quadrants of the plane straight.
Convert the in-X,Y-plane-projection value of the PUVs to Degree/Minute/Second format, and then turn your rotary table so that the OUTBOUND Perpendicular Unit Vector lies in the Z(Machine),X(Machine) plane AWAY from the hinge of the Tilt Plate.
Now calculate the Tilt Angle by taking the ArcCosine of the z component of the OUTBOUND PUV, and set the Tilt Plate. This rwill rotate the workpiece in the machine Z/X plane, and make the PUV square to the Machine X/Y plane.
I hope that my hurried description is clear enough for you to follow. As I said at the beginning, I'm swamped with a special project right now, and won't be able to get back online before NEXT weekend, which is going to be too late to answer questions. Having said that, about all I can add is Good Luck!
John