The GetReqHdg() method in the Waypoint Encounter class steers the aircraft onto its correct course to fly over the waypoint and leave it on a heading equal to the selected outbound radial. This it does by re-computing the required heading (ReqHdg) every 50 milliseconds and passing it as a command to the aircraft's flight control system.
But suppose strong winds keep blowing the aircraft off course. If this occurs while the aircraft is approaching the waypoint, the regularly re-computed ReqHdg maintains the aircraft on a course which is always tangential to the closest turning circle. If it occurs after the aircraft has passed the waypoint, the regularly re-computed ReqHdg steers the aircraft back onto the outbound radial. This it does in a way which maintains the aircraft on a constant asymptotic approach to the radial from wherever it finds itself.
If the aircraft is suddenly gusted off course when it is close to the waypoint, it may not be obvious from one re-computation to the next whether the aircraft is approaching the waypoint or whether it has passed it. This is solved by decreeing that the approach phase ends at the point when the aircraft's track hits or intersects the rim of one of the turning circles. From that point, the ReqHdg is determined by the outbound algorithm. Tests have shown this to work for wind gusts in excess of the aircraft's ground speed.