Check out Stanford University's Dynamic Design Lab. They have a driver assistance system to help drivers avoid collisions. (
http://www-cdr.stanford.edu/dynamic/PF/p_fields.html) This is obviously too complicated for a swimmer, but might point you in a direction for further research.