mrpas field of view algorithm javascript port