Screenshot of the Rome2Rio website implementing this pattern of having a departure point and a destination as input fields and a button between them allowing to swap their values.
https://files.mastodon.social/media_attachments/files/113/288/991/603/934/540/original/69752e05cd751df3.png