Align the Z axis of the planes

I do need to align the Z direction of the planes to point all into the same direction but I can’t find a proper way to do so. I do have calculated points for Origin, X, Y and Z of the planes but I don’t know how to orient all the planes to point into same direction?

Basically I do need to flip the Blue axis to point into the same direction without changing the Red and Yellow axis.

Whatever I tried it is failing, I can orient a plane only using three point, but I do need to align them using four points.

After that I do need to place on top of that planes some other geometries that needs to be aligned with that planes and to point into the same direction.

Flip Plane.gh (14.2 MB)

missing

I don’t see the Flip Plane (PFlip) component in your code? Inside a cluster, perhaps?