Calculate time for each point
for ( let i = 0 ; i < N ; i ++ ) { let x = D [ i ] [ 0 ] ; let y = D [ i ] [ 1 ] ; let speed = D [ i ] [ 2 ] ; let time = ( ( x * x - X * X ) + ( y * y - Y * Y ) ) / ( speed * speed ) ; T . push ( time ) ; }