If he takes account for the current and makes sure that he ends up directly across from where he started, the swimmer will have to swim slightly upriver to have a resultant vector that points directly across the river.

The pythagorean theorem is used now to find the resultant 'r'.
This resultant vector points directly across the river, so we can use it to find out how long it will take the swimmer to make it across.