2010-12-13 18 views

Répondre

1

Vous obtiendrez le point dans le tableau points qui est plus proche du point current:

Point closest = points.OrderBy(
    p => Math.Sqrt(Math.Pow(p.X - current.X, 2.0) + Math.Pow(p.Y - current.Y, 2.0)) 
).First(); 
+0

Vous n'avez pas besoin que 'Sqrt' là-dedans. – sje397