Minecraft wiki entry for Target_selectors, associated text: Examples in Bedrock Edition:
@e[rxm=0,rx=0] — Selects all entities that are looking directly at the horizon.
@e[rxm=30,rx=60] — Selects all entities that are looking between 30° and 60° (inclusive) below the horizon.
@e[rx=0] — Select all entities that are looking at or above the horizon.