This answer is based on the solution shown here:
How to correct curve tilt, tangents and normals of a curve?
However, your question is only about recognizing the orientation of the tangents in order to deduce which curves need to be reversed, which is why I am only applying part of this solution here.
The principle is simple:
- You first determine the direction from the center of each spline to each point of the spline.
- If you then generate the cross product of the tangent of the curve points and this direction, and generate the dot product with $(0,0,1)$ or $(0,0,-1)$, this resulting value is either positive or negative per point. However, you need to capture this value with
Capture Attribute in the point domain!
- If you then plug this value directly into the input Selection of the node
Reverse Curve, it will be interpolated from the Point domain to the Spline domain, and used as a boolean value. This way the alignment of your curves is consistent throughout.