The main challenge in solving this problem is how to determine where north is within the coordinate system of RealityView.
I’ve found that RealityView’s coordinate system guarantees that the Y-axis is always perpendicular to the ground (with the Y-axis pointing towards the sky),
but it does not guarantee that the X-axis is parallel to the longitude and the Z-axis is parallel to the latitude.