A fast algorithm for muon track reconstruction and its application to the ANTARES neutrino telescope