Distance from one focus point to all other points in grid

I am very new to coding. I have a grid of points, controlled by two boundary points and sliders for columns and rows in Grasshopper. I am trying to add code to my c# component that, given another point (Focus), finds the distance from that point Focus to all of the other points. So, if my grid has 240 points, I should have 240 distance values when I am done. I know that from point [k], the different combinations are k+1, k-1, k+columns+1, k-columns+1, k-columns-1, and k+columns-1 to its neighbors, I just do not know how to go about finding the distances to all points.

Here is what I have so far:



6tlmT

Thanks!

After:
Points.Add(p);

put in:
distance.Add(p.DistanceTo(focus));

1 Like

Thank you!