I can’t share the file, but here is the merit function showing the rotation matrix for a given surface. Also shown are the 3 outputs of the ZPL19 macro.

The tilt Z value of 180° does not agree with a macro I wrote or ATAN2 in excel. I even used some if statements to match your ZPL19 macro steps in excel, but even this disagrees with the macro in Zemax. See below.


Any thoughts?
Also, this is one more request for a built-in ZPL function or merit function operand to report tilt X, Y, Z values for a given surface.
-Sean


