The finite element method as a solution of the eikonal equation