Can a frightened creature freely circle the source of its fear?

A frightened creature A is standing horizontally or vertically next to the source of its fear B.

The creature can’t willingly move closer to the source of its fear.

Can A freely circle B, for example to flank them or to attack another of its enemies, or to pass them with impunity in a 10′ hallway (subject to AOO rules as normal of course)?

I am asking, because this seems somewhat counter-intuitive: If you are next to the source of your fear, the fear does not practically restrict your movement. I hope there’s something in the rules or maybe sage advice which clarifies this, other than just lack of restrictions that would apply.